Re: Anyone remember what AC_PROG_GCC_TRADITIONAL was testing for?

Paul Eggert <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.general
Organization UCLA Computer Science Department
Message-ID <[email protected]>
That macro dates back to /usr/include header files that would play 
tricks like this

      #define _IO(n, x) (('n'<<8)+x) 

      #define TIOCFOO _IO(T, 1) 


and would expect TIOCFOO to be equivalent to (('T'<<8)+1). This sort of 
trick worked with K&R C compilers but does not work with C89+. To work 
around the problem back in the day, you needed to use 'gcc -traditional'.

Using -traditional had obvious problems, though, so GCC soon changed its 
installation procedure "fixincludes" to make fixed copies of these 
K&R-assuming headers during installation, and to compile by including 
the fixed copies. This was around 1990. I was involved with some of that 
header-munging effort but have blessedly forgotten most of the details. 
A descendant of the fixincludes work is still in GCC's source code 
(which is where I got the above example).

AC_PROG_GCC_TRADITIONAL has not been needed for thirty years, and was 
declared obsolescent in Autoconf 2.60 (2006-06-05). Also, the Autoconf 
manual (as of the next version) states Autoconf assumes C89 or later. So 
if there's any issue with AC_PROG_GCC_TRADITIONAL at all, I suggest 
replacing its definition with:

   AU_DEFUN([AC_PROG_GCC_TRADITIONAL])

and updating documentation and tests and etc. accordingly.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.