public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Inconsistent Compilation
@ 2006-02-21  0:55 GlassEyeSlim
  2006-02-21  0:55 ` Inconsistent Compilation - Precompiled Header GlassEyeSlim
  0 siblings, 1 reply; 2+ messages in thread
From: GlassEyeSlim @ 2006-02-21  0:55 UTC (permalink / raw)
  To: gcc-help


With the following include statement and the associated header file in the
same directory as the .c file:

#include "stdio.h"

gcc will compile successfully using the following

$gcc -x none file.c

With the following include statement and the associated header file in
/usr/include

#include <stdio.h"

gcc will not compile the file using any of the following

$gcc -x c file.c
$gcc -x none file.c
$gcc -std=c89 file.c

GES
--
View this message in context: http://www.nabble.com/Inconsistent-Compilation-t1158935.html#a3041947
Sent from the gcc - Help forum at Nabble.com.

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

* Inconsistent Compilation - Precompiled Header
  2006-02-21  0:55 Inconsistent Compilation GlassEyeSlim
@ 2006-02-21  0:55 ` GlassEyeSlim
  0 siblings, 0 replies; 2+ messages in thread
From: GlassEyeSlim @ 2006-02-21  0:55 UTC (permalink / raw)
  To: gcc-help


How about this...

If I compile a file with the stdio.h header in the same directory, a
precompiled header is kicked out: stdio.h.gch

If that .gch file is moved to /usr/include then compilation will proceed
without any errors when the following statement is used:

#include <stdio.h>

According to:
http://gcc.gnu.org/onlinedocs/gcc-3.4.1/gcc/Precompiled-Headers.html

only one precompiled header may be used during any compilation...so this
proves to be a solution for small projects.

More...if the following is entered, a list of syntax errors results:

$ pwd
/usr/include
$ gcc -x none stdio.h

GES
--
View this message in context: http://www.nabble.com/Inconsistent-Compilation-t1158935.html#a3042045
Sent from the gcc - Help forum at Nabble.com.

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

end of thread, other threads:[~2006-02-21  0:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-21  0:55 Inconsistent Compilation GlassEyeSlim
2006-02-21  0:55 ` Inconsistent Compilation - Precompiled Header GlassEyeSlim

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).