Bug 47029 - fixincludes: the fix for c99 inlines in the glibc header files fixes function declarations as well as function definitions
Summary: fixincludes: the fix for c99 inlines in the glibc header files fixes function...
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.4.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-21 08:31 UTC by Hari Kodungallur
Modified: 2022-01-09 04:30 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-12-28 16:11:23


Attachments
/usr/include/sys/stat.h from a CentOS 5.5 server. (3.91 KB, application/octet-stream)
2011-01-31 20:54 UTC, Hari Kodungallur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hari Kodungallur 2010-12-21 08:31:09 UTC
I am building gcc version 4.4.2 on centos 32-bit machine.

# uname -a
Linux rh55-i386 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 EDT 2010 i686 i686 i386 GNU/Linux

The build is successful. But my project fails to build using this built gcc.

The error (actually warning; we have -Werror set) is:

/opt/gcc-4.4.2/bin/../lib/gcc/i686-pc-linux-gnu/4.4.2/include-fixed/sys/stat.h:317: warning: inline function ‘lstat64’ declared but never defined
/opt/gcc-4.4.2/bin/../lib/gcc/i686-pc-linux-gnu/4.4.2/include-fixed/sys/stat.h:286: warning: inline function ‘fstatat64’ declared but never defined
/opt/gcc-4.4.2/bin/../lib/gcc/i686-pc-linux-gnu/4.4.2/include-fixed/sys/stat.h:255: warning: inline function ‘fstat64’ declared but never defined
/opt/gcc-4.4.2/bin/../lib/gcc/i686-pc-linux-gnu/4.4.2/include-fixed/sys/stat.h:250: warning: inline function ‘stat64’ declared but never defined


The version of glibc on the system is:

# rpm -q glibc
glibc-2.5-49


It looks like fixincludes 'fixes' the function declarations as well, converting them to extern inline. Example:

this one from <sys/stat.h>:

#ifndef __USE_FILE_OFFSET64
/* Get file attributes for FILE and put them in BUF.  */
extern int stat (__const char *__restrict __file,
                struct stat *__restrict __buf) __THROW __nonnull ((1, 2));


gets converted to the following in the includes-fixed/sys/stat.h:

#ifndef __USE_FILE_OFFSET64
/* Get file attributes for FILE and put them in BUF.  */
#ifdef __GNUC_GNU_INLINE__
extern
#endif
__inline__ int stat (__const char *__restrict __file,
                struct stat *__restrict __buf) __THROW __nonnull ((1, 2));


Similar thing for all the stat/lstat/fstat and stat64/lstat64/fstat64 functions.

The fixincludes should fix only the function definitions. 
Although I've marked it as in Version 4.4.2, apparently this bug is present in the latest code.


[Ref: This issue was discussed earlier today in the gcc-help list on this thread: http://gcc.gnu.org/ml/gcc-help/2010-12/msg00197.html]
Comment 1 Richard Biener 2010-12-28 16:11:23 UTC
The glibc is a "little" bit old.  Please attach the headerfile.
Comment 2 Hari Kodungallur 2011-01-31 20:54:57 UTC
Created attachment 23187 [details]
/usr/include/sys/stat.h from a CentOS 5.5 server.
Comment 3 Hari Kodungallur 2011-01-31 20:55:37 UTC
Sorry for the delay. I was on vacation. I've attached the stat.h header file.