You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CXX_EXTENSIONS property is set to off in multiple CMake files in clr, but non-standard features are used so this property should be enabled.
Most compilers silently allow extensions unless -Wpedantic or specific warnings for extensions are enabled so there's no warning by default. Adding -Wpedantic or specific warnings like Wgnu-zero-variadic-macro-arguments to CXXFLAGS finds multiple places relying on extensions.
/build/source/rocclr/utils/debug.hpp:196:64: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments]
196 | amd::log_printf( hipMemcpyHtoA
level, __FILENAME__, __LINE__, format, ##__VA_ARGS__); \
|
/build/source/rocclr/platform/memory.hpp:204:5: error: anonymous structs are a GNU extension [-Werror,-Wgnu-anonymous-struct]
204 | struct {
| ^
/build/source/rocclr/platform/memory.hpp:204:5: error: anonymous types declared in an anonymous union are an extension [-Werror,-Wnested-anon-types]
The text was updated successfully, but these errors were encountered:
Hi @LunNova, setting CXX_EXTENSIONS OFF will set the -std flag in GCC to use the base standard which disables GNU extensions that do not contradict the standard specified but does not disable all GNU extensions. This is mentioned in the C Dialect Options in the GCC docs:
When a base standard is specified, the compiler accepts all programs following that standard plus those using GNU extensions that do not contradict it. For example, -std=c90 turns off certain features of GCC that are incompatible with ISO C90, such as the asm and typeof keywords, but not other GNU extensions that do not have a meaning in ISO C90, such as omitting the middle term of a ?: expression. On the other hand, when a GNU dialect of a standard is specified, all features supported by the compiler are enabled, even when those features change the meaning of the base standard. As a result, some strict-conforming programs may be rejected. The particular standard is used by -Wpedantic to identify which features are GNU extensions given that version of the standard. For example -std=gnu90 -Wpedantic warns about C++ style ‘//’ comments, while -std=gnu99 -Wpedantic does not.
so CXX_EXTENSIONS does not have to be on to use those extensions. Let me know if you have any other questions!
The
CXX_EXTENSIONS
property is set to off in multiple CMake files in clr, but non-standard features are used so this property should be enabled.Most compilers silently allow extensions unless
-Wpedantic
or specific warnings for extensions are enabled so there's no warning by default. Adding-Wpedantic
or specific warnings likeWgnu-zero-variadic-macro-arguments
to CXXFLAGS finds multiple places relying on extensions.The text was updated successfully, but these errors were encountered: