intel / intel-graphics-compiler

Other
606 stars 158 forks source link

Avoid setting -Werror in non-development builds? #214

Closed rcombs closed 3 years ago

rcombs commented 3 years ago

This can cause issues when different versions of compilers include different warnings in -Wall or -Wextra, or vary the semantics of existing ones. For instance, on my particular build of clang 11.0.1, I get this warning:

intel-graphics-compiler/IGC/../visa/include/JitterDataStruct.h:21:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
typedef struct {
              ^
               FINALIZER_INFO
intel-graphics-compiler/IGC/../visa/include/JitterDataStruct.h:29:33: note: type is not C-compatible due to this default member initializer
    unsigned int spillMemUsed = 0;
                                ^
intel-graphics-compiler/IGC/../visa/include/JitterDataStruct.h:71:3: note: type is given name 'FINALIZER_INFO' for linkage purposes by this typedef declaration
} FINALIZER_INFO;
  ^
2 warnings generated.

Which requires me to patch out the CMake code setting -Werror. There's not a lot of value to -Werror outside of development, so could this be removed (or could an option be added to disable it)?

pszymich commented 3 years ago

Hi @rcombs,

This issue should be fixed by e382784f5d1ccc055a348a6bb103f72c0bade385, thanks @mnaczk! Please reopen this issue if you find that the problem is still there, thank you!

rcombs commented 3 years ago

That commit fixes the specific warning I was getting, but doesn't fix the general issue of warnings from new compilers causing errors for no good reason.