public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug pch/17162] New: warning about invalid precompiled header even if the correct one is used
@ 2004-08-24  2:02 rodolfo at rodsoft dot org
  2004-08-24  2:05 ` [Bug pch/17162] " rodolfo at rodsoft dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rodolfo at rodsoft dot org @ 2004-08-24  2:02 UTC (permalink / raw)
  To: gcc-bugs

When using precompiled headers (pch for short) in a way where I can have 
several versions of the same header precompiled with different compiler options
(all pch:s in directory (pch.h.gch for instance), and if I'm using -Winvalid-pch, 
gcc emits a warning for every invalid pch found in the directory
until it gets the right one. It gets pretty annoying when using -Werror. This
shouldn't happen because it finds the correct pch. The warning should be 
shown if gcc doesn't find a valid precompiled header at all.
Here's a test case:

/* test.c */
#include "pch.h"
int main() { return 0; }

/* pch.h empty */

/* Makefile */
all: test1 test2

clean:
        rm -rf *.o test1 test2 pch.h.gch

test1: test.c pch.h.gch/pch.pic
        gcc -H -Winvalid-pch -fpic -o $@ $<
        
test2: test.c pch.h.gch/pch.nonpic
        gcc -H -Winvalid-pch  -o $@ $<

pch.h.gch/pch.pic: pch.h
        mkdir -p pch.h.gch
        gcc -fpic -o $@ $<
        
pch.h.gch/pch.nonpic: pch.h
        mkdir -p pch.h.gch
        gcc -o $@ $<

/* END OF TESTCASE */

When running make, the following is output:

mkdir -p pch.h.gch
gcc -fpic -o pch.h.gch/pch.pic pch.h
gcc -H -Winvalid-pch -fpic -o test1 test.c
! pch.h.gch/pch.pic
mkdir -p pch.h.gch
gcc -o pch.h.gch/pch.nonpic pch.h
gcc -H -Winvalid-pch  -o test2 test.c
test.c:1:17: warning: pch.h.gch/pch.pic: created and used with different settings of -fpic
x pch.h.gch/pch.pic
! pch.h.gch/pch.nonpic

-- 
           Summary: warning about invalid precompiled header even if the
                    correct one is used
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: pch
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rodolfo at rodsoft dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2004-08-31  1:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-24  2:02 [Bug pch/17162] New: warning about invalid precompiled header even if the correct one is used rodolfo at rodsoft dot org
2004-08-24  2:05 ` [Bug pch/17162] " rodolfo at rodsoft dot org
2004-08-30 21:28 ` geoffk at gcc dot gnu dot org
2004-08-31  1:04 ` rodolfo at rodsoft 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).