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]

Re: 2.95.3 destruction in Linux header



> > The code fragment was boiled down from a device driver, and
> > apparently various things are left undefined by the system headers
> > that the program includes.
> > The effect seems to be that the program works with old gcc's but not
> > with 2.95.3.
> 
> This seems very odd.  Are both gcc versions really using the same headers?

In one case the headers that contain the missing definitions are not
processed, even though the .i file seems to mention their names.  In the other
case the files are found and processed.


Here are non-failing and failing cases, using the same 2.95.3 compiler for
both, and with a more recent linux.

uname -a
Linux suse 2.4.2 #2 Tue Mar 20 08:54:03 EST 2001 i586 unknown

tst.c:
#include <linux/fs.h>


gcc -D__KERNEL__ -I/usr/src/linux/include -v -c tst.c
Reading specs from /usr/lib/gcc-lib/i486-linux/2.95.3/specs
gcc version 2.95.3 20010312 (prerelease)
...
#include <...> search starts here:
 /usr/src/linux/include
 /usr/local/include
 /usr/lib/gcc-lib/i486-linux/2.95.3/../../../../i486-linux/include
 /usr/lib/gcc-lib/i486-linux/2.95.3/include
 /usr/include
(No errors reported.)


gcc -D__KERNEL__ -v -c tst.c
Reading specs from /usr/lib/gcc-lib/i486-linux/2.95.3/specs
gcc version 2.95.3 20010312 (prerelease)
...
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i486-linux/2.95.3/../../../../i486-linux/include
 /usr/lib/gcc-lib/i486-linux/2.95.3/include
 /usr/include
...
GNU C version 2.95.3 20010312 (prerelease) (i486-linux) compiled by GNU C version 2.95.3 20010312 (prerelease).
In file included from /usr/include/linux/dcache.h:7,
                 from /usr/include/linux/fs.h:19,
                 from tst.c:1:
/usr/include/linux/mount.h:32: parse error before `uid_t'
... many more error messages


Here are the links to the linux header files.
  cd /usr/include
  ls -l linux
  linux -> ../src/linux/include/linux
  ls -l asm
  asm -> ../src/linux/include/asm-i386



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