Re: conditional compile...
- From: Chris Dollin <chris.dollin@xxxxxx>
- Date: Fri, 30 Nov 2007 14:41:12 +0000
naunetr wrote:
hello all,
i wrote the small program below to practice conditional compiling. if i
define MYSYMBOL then everthing works fine, but when i comment MYSYMBOL
gcc gives the following message:
cnd_compile01.c:4:2: error: #error "Error"
cnd_compile01.c:1: warning: ISO C forbids an empty source file
i cant understand the warning and how to eliminate it? i tried placing
some dummy comment but still the same warning.
You need real code. A static declaration will do; comments won't.
also why is compiler printing error twice. it looks ugly. is there a
way to make it print error once only?
Pass [1]. But who cares? The way to stop it printing `error` twice is to
stop it printing `error` at all. If there's a real error error, the
repeated text is likely to be the least of your problems.
[1] If there is, it will be compiler specific. gcc has many many command-
line options, many of which control diagnostic reports.
--
Chris "it was deliberate" Dollin
Hewlett-Packard Limited Cain Road, Bracknell, registered no:
registered office: Berks RG12 1HN 690597 England
.
- References:
- conditional compile...
- From: naunetr
- conditional compile...
- Prev by Date: Re: memcat fn
- Next by Date: Compile error on WinXP/MSVC++E05
- Previous by thread: conditional compile...
- Next by thread: Compile error on WinXP/MSVC++E05
- Index(es):
Relevant Pages
|