From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32034 invoked by alias); 16 May 2011 15:29:10 -0000 Received: (qmail 32024 invoked by uid 22791); 16 May 2011 15:29:10 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 May 2011 15:28:56 +0000 From: "psmith at gnu dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/48996] fixincl on Red Hat EL 5 breaks sys/stat.h fstat64() X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: psmith at gnu dot org X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 16 May 2011 15:29:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01269.txt.bz2 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 :-).