Is there a way to conditionally enable features that rely on GCC extensions (such as __int128
) if they would compile?
I want to do something like
void foo(int);
void foo(long);
void foo(long long);
#if not_pedantic
void foo(__int128);
#endif
I could not find a macro that is defined when -pedantic
or pedantic-error
is passed.
This is a bad idea. Only check the compiler, and disable the -pedantic-errors
warnings with #pragma
s or __extension__
:
void foo(int);
void foo(long);
void foo(long long);
#ifdef __GNUC__
__extension__ void foo(__int128);
#endif
If your user builds with -pedantic-errors
but still uses the extensions as needed, they would be very annoyed if you disable overloads like this.