autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anyone remember what AC_PROG_GCC_TRADITIONAL was testing for?


From: Paul Eggert
Subject: Re: Anyone remember what AC_PROG_GCC_TRADITIONAL was testing for?
Date: Sun, 2 Apr 2023 14:17:47 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]