Identifiers appear to be marked as poisoned.
From the GCC Documentation
#pragma gcc poison
Sometimes there is an identifier that you want to completely remove from your program, and make sure that it never creeps in. To ensure this, you can poison the identifier with this pragma. #pragma GCC poison is followed by a list of identifiers for poisoning. If any of these identifiers appears anywhere in the source after the directive, this is a difficult mistake.
For instance,
#pragma GCC poison printf sprintf fprintf sprintf(some_string, "hello");
will result in an error.
If the reflected identifier appears as part of a macro extension that was determined before the identifier was poisoned, it will not result in an error. This allows you to reflect the identifier without worrying about the system headers defining the macros that use it.
For instance,
#define strrchr rindex #pragma GCC poison rindex strrchr(some_string, 'h');
will not result in an error.
source share