Is “unix” restricted keyword in C?

unix is not a identifier reserved by the Standard.

If you compile with -std=c89 or -std=c99 the gcc compiler will accept the program as you expected.

From gcc manual ( https://gcc.gnu.org/onlinedocs/cpp/System-specific-Predefined-Macros.html ), the emphasis is mine.

… However,
historically system-specific macros
have had names with no special prefix;
for instance, it is common to find
unix defined on Unix systems
. For all
such macros, GCC provides a parallel
macro with two underscores added at
the beginning and the end. If unix is
defined, __unix__ will be defined too.
There will never be more than two
underscores; the parallel of _mips is
__mips__.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)