This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/65128] remove "linux" and "unix" from preprocessor macros from cpp-5


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65128

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://gcc.gnu.org/onlinedocs/gcc-5.3.0/cpp/System-specific-Predefined-Macros.html#System-specific-Predefined-Macros


The C standard requires that all system-specific macros be part of the reserved
namespace. All names which begin with two underscores, or an underscore and a
capital letter, are reserved for the compiler and library to use as they wish.
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__.



We are slowly phasing out all predefined macros which are outside the reserved
namespace. You should never use them in new programs, and we encourage you to
correct older code to use the parallel macros whenever you find it. We don't
recommend you use the system-specific macros that are in the reserved
namespace, either. It is better in the long run to check specifically for
features you need, using a tool such as autoconf.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]