Description of problem: #defined (linux) macro not supported when program is compiled in ANSI mode. Version-Release number of selected component (if applicable): gcc - 3.2.3-49 glibc - 2.3.2-95.30 How reproducible: Steps to Reproduce: 1. g++ -ansi ansi.cpp 2. ./a.out Actual results: Not defined Expected results: Defined Additional info: works properly when compiled with - g++ ansi.cpp
Created attachment 111251 [details] Test case to reproduce the bug
This macro is being used at many places in our product. Substituting the #defined (linux) with something else is not a feasible solution. This problem is seen when the code is compiled in ANSI mode. Could you please suggest a way to make this macro available (besides sending -Dlinux during make) ?
That's on purpose, since linux macro violates the ISO C89/C99/C++98 namaspace. A conforming ISO C89/C99/C++98 program can e.g. be int linux; or void linux (void) {} See e.g. info gcc, search for -ansi. You can use __linux or __linux__ macros instead.