public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/48996] New: fixincl on Red Hat EL 5 breaks sys/stat.h fstat64()
@ 2011-05-14  6:47 psmith at gnu dot org
  2011-05-16 11:28 ` [Bug c/48996] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: psmith at gnu dot org @ 2011-05-14  6:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48996

           Summary: fixincl on Red Hat EL 5 breaks sys/stat.h fstat64()
           Product: gcc
           Version: 4.5.3
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: psmith@gnu.org


Hi all.  When I run fixincl from GCC 4.5.3 on my Red Hat EL 5 system, the
resulting sys/stat.h will throw an error whenever I try to call fstat64() from
my code.  If I delete sys/stat.h from the include-fixed directory, so the
original is used, then all is happy again.

Before fixincl the code reads:

extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));

After fixincl it reads:

#ifdef __GNUC_GNU_INLINE__
extern
#endif
__inline__ int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull
((2));

and the compiler error I get is:

include-fixed/sys/stat.h:255:16: error: inline function 'int fstat64(int,
stat64*)' used but never defined

where line 255 is the __inline__ line above.

Checking with the preprocessor I see that __GNUC_GNU_INLINE__ is built-in
defined to be 1.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/48996] fixincl on Red Hat EL 5 breaks sys/stat.h fstat64()
  2011-05-14  6:47 [Bug c/48996] New: fixincl on Red Hat EL 5 breaks sys/stat.h fstat64() psmith at gnu dot org
@ 2011-05-16 11:28 ` rguenth at gcc dot gnu.org
  2011-05-16 13:00 ` psmith at gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-05-16 11:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48996

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2011.05.16 11:04:03
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-16 11:04:03 UTC ---
Please provide the un-fixincluded sys/stat.h file.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/48996] fixincl on Red Hat EL 5 breaks sys/stat.h fstat64()
  2011-05-14  6:47 [Bug c/48996] New: fixincl on Red Hat EL 5 breaks sys/stat.h fstat64() psmith at gnu dot org
  2011-05-16 11:28 ` [Bug c/48996] " rguenth at gcc dot gnu.org
@ 2011-05-16 13:00 ` psmith at gnu dot org
  2011-05-16 13:26 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: psmith at gnu dot org @ 2011-05-16 13:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48996

--- Comment #2 from psmith at gnu dot org 2011-05-16 11:56:33 UTC ---
Created attachment 24251
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24251
Un-fixed sys/stat.h

Yes, sorry, it was silly not to have done that.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/48996] fixincl on Red Hat EL 5 breaks sys/stat.h fstat64()
  2011-05-14  6:47 [Bug c/48996] New: fixincl on Red Hat EL 5 breaks sys/stat.h fstat64() psmith at gnu dot org
  2011-05-16 11:28 ` [Bug c/48996] " rguenth at gcc dot gnu.org
  2011-05-16 13:00 ` psmith at gnu dot org
@ 2011-05-16 13:26 ` rguenth at gcc dot gnu.org
  2011-05-16 15:29 ` psmith at gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-05-16 13:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48996

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-16 13:07:56 UTC ---
I don't see anything wrong with the fixinclude though it is a bit fragile
as it wants to fixup both prototype and redicrected inline function and
both are not guarded with the same #ifdefs:


#ifdef __USE_LARGEFILE64
extern int stat64 (__const char *__restrict __file,
                   struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
#endif

but

# if defined __USE_LARGEFILE64 \
  && (! defined __USE_FILE_OFFSET64 \
      || (defined __REDIRECT_NTH && defined __OPTIMIZE__))
extern __inline__ int
__NTH (fstat64 (int __fd, struct stat64 *__statbuf))
{
  return __fxstat64 (_STAT_VER, __fd, __statbuf);
}
...

so if only the fixed fstat64 prototype remains after preprocessing that
will trigger the error you saw.

So, do you have a testcase that fails to build?  And which flags do
you pass?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/48996] fixincl on Red Hat EL 5 breaks sys/stat.h fstat64()
  2011-05-14  6:47 [Bug c/48996] New: fixincl on Red Hat EL 5 breaks sys/stat.h fstat64() psmith at gnu dot org
                   ` (2 preceding siblings ...)
  2011-05-16 13:26 ` rguenth at gcc dot gnu.org
@ 2011-05-16 15:29 ` psmith at gnu dot org
  2011-05-16 16:22 ` psmith at gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: psmith at gnu dot org @ 2011-05-16 15:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48996

--- Comment #4 from psmith at gnu dot org 2011-05-16 15:07:40 UTC ---
I'm attaching a small test program that fails for me.  I'm just running the
compiler with "c++ -o tstfstat.o -c tstfstat.cpp"; no extra flags.

After looking more carefully I can see that when I build this without
optimization I get this problem; the ifdef around the definition of the inline
version is:

# if defined __USE_LARGEFILE64 \
  && (! defined __USE_FILE_OFFSET64 \
      || (defined __REDIRECT_NTH && defined __OPTIMIZE__))

In my system __USE_LARGEFILE64 is 1, __USE_FILE_OFFSET64 is 1, and
__REDIRECT_NTH is defined.  So, this entire if statement is true if
__OPTIMIZE__ is true, and false otherwise.

On the other hand the declaration doesn't care about __OPTIMIZE__; it declares
the function to be __inline__ regardless.

Sure enough, when I add -O2 to the compile line I don't see any complaints from
the compiler.  However that's not something I can do :-).


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/48996] fixincl on Red Hat EL 5 breaks sys/stat.h fstat64()
  2011-05-14  6:47 [Bug c/48996] New: fixincl on Red Hat EL 5 breaks sys/stat.h fstat64() psmith at gnu dot org
                   ` (3 preceding siblings ...)
  2011-05-16 15:29 ` psmith at gnu dot org
@ 2011-05-16 16:22 ` psmith at gnu dot org
  2015-03-17  6:49 ` mpolacek at gcc dot gnu.org
  2015-03-18 19:35 ` psmith at gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: psmith at gnu dot org @ 2011-05-16 16:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48996

--- Comment #5 from psmith at gnu dot org 2011-05-16 15:08:35 UTC ---
Created attachment 24253
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24253
Test invocation of fstat64()


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/48996] fixincl on Red Hat EL 5 breaks sys/stat.h fstat64()
  2011-05-14  6:47 [Bug c/48996] New: fixincl on Red Hat EL 5 breaks sys/stat.h fstat64() psmith at gnu dot org
                   ` (4 preceding siblings ...)
  2011-05-16 16:22 ` psmith at gnu dot org
@ 2015-03-17  6:49 ` mpolacek at gcc dot gnu.org
  2015-03-18 19:35 ` psmith at gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-17  6:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48996

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
                 CC|                            |mpolacek at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Looks like a NOTABUG, and hardly a C FE issue.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/48996] fixincl on Red Hat EL 5 breaks sys/stat.h fstat64()
  2011-05-14  6:47 [Bug c/48996] New: fixincl on Red Hat EL 5 breaks sys/stat.h fstat64() psmith at gnu dot org
                   ` (5 preceding siblings ...)
  2015-03-17  6:49 ` mpolacek at gcc dot gnu.org
@ 2015-03-18 19:35 ` psmith at gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: psmith at gnu dot org @ 2015-03-18 19:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48996

--- Comment #7 from Paul Smith <psmith at gnu dot org> ---
I haven't seen this issue in a while and don't care enough to try to reproduce
it or to have it reopened, but as far as I can see the problem was pretty
clearly in the fixincl tool that comes with GCC.  I don't know if that's
considered "C FE" or not; perhaps I mis-categorized it.

Fixincl was adding __inline__ to functions in header files it was fixing, quite
inappropriately (in this case anyway).


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-18 19:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-14  6:47 [Bug c/48996] New: fixincl on Red Hat EL 5 breaks sys/stat.h fstat64() psmith at gnu dot org
2011-05-16 11:28 ` [Bug c/48996] " rguenth at gcc dot gnu.org
2011-05-16 13:00 ` psmith at gnu dot org
2011-05-16 13:26 ` rguenth at gcc dot gnu.org
2011-05-16 15:29 ` psmith at gnu dot org
2011-05-16 16:22 ` psmith at gnu dot org
2015-03-17  6:49 ` mpolacek at gcc dot gnu.org
2015-03-18 19:35 ` psmith at gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).