Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28907 Discussions

Why is the word "unix" a predefined pre-processor macro in ifort 2021.7

Richard_Weed
Novice
1,188 Views

I tried to build the Fortran Package Manager (fpm) using ifort instead of the default gfortran and encountered an error that indicates that the word "unix" (all lower case) is a predefined pre-processor macro in ifort 2021.7 (haven't tried ifx yet). In fpm "unix" is used in several places as a logical variable name. However, when I try to compile with ifort 2021.7 "unix" is replaced with a "1" (one) indicating that the preprocessor is replacing "unix" with "1". The easy fix is add -Uunix to the compile line but I don't think this should be necessary. So question: is this a bug or a feature.

0 Kudos
4 Replies
JohnNichols
Valued Contributor III
1,180 Views

Bug definition :: One could look at it as a useful undocumented feature. 

0 Kudos
AlHill
Super User
1,174 Views

Or, a bug-like feature.

 

Doc (not an Intel employee or contractor)
[Maybe Windows 12 will be better]

0 Kudos
Steve_Lionel
Honored Contributor III
1,166 Views

More or less a feature - there are quite a few predefined preprocessor symbols, as documented at Predefined Preprocessor Symbols (intel.com)

While "linux" is listed, I don't see "unix" there. If "unix" is predefined, the documentation should say so. This is a general problem with preprocessing, however, when there are name clashes. Most of the names have leading underscores, but I know it was a popular convention in the past for compilers to define some of these names as undecorated lowercase.

0 Kudos
JohnNichols
Valued Contributor III
1,158 Views

The problem with unix is the borrowing of names from LISP and then the continued use of the arcane command names, which continues to this day. 

From LISP examples,   car()   contents of the address register, and cdr() contents of the decrement register, I mean LISP was invented soon after eniac, but unix was not.  

At least I can read a LISP file if it is written by someone who uses good descriptors, but C is a nightmare to read.  

Give me a Fortran map.  

 

 

0 Kudos
Reply