Page MenuHomePhabricator

[OpenMP] Redefined macro warning in libomptarget

Authored by grokos on Jan 31 2017, 3:32 PM.



After commit rL293468, macro __STDC_FORMAT_MACROS is defined twice:

  1. the compile line for omptarget.cpp specifies -D__STDC_FORMAT_MACROS
  2. Now the macro is also defined in omptarget.h

This results in a warning. If libomptarget is compiled with -Werror, compilation will fail.
This is a patch which allow the definition of that macro in omptarget.h only if it has not been defined again.

Thanks to Carlo for finding out about the problem.

Diff Detail


Event Timeline

grokos created this revision.Jan 31 2017, 3:32 PM
Hahnfeld accepted this revision.Jan 31 2017, 11:13 PM

Ah, I see: LLVM root's CMakeLists.txt adds the definition. I tested an out-of-tree Debug build where this is not the case. Sorry for the trouble!

This revision is now accepted and ready to land.Jan 31 2017, 11:13 PM
This revision was automatically updated to reflect the committed changes.