Path: utzoo!telly!ddsw1!lll-winken!killer!pollux!ti-csl!cs.utexas.edu!tut.cis.ohio-state.edu!morgan.com!frank
From: frank@morgan.com (Frank Wortner)
Newsgroups: gnu.gcc.bug
Subject: Problem Compiling Certain Bad C Code
Message-ID: <8809201612.AA10674@s2.Morgan.COM>
Date: 20 Sep 88 16:12:34 GMT
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: frank@morgan.com
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 36

I've run into a number of problems compiling certain bits of C code.
GCC reports syntax errors on files which pass through CC without
problems.  In investigating this problem, I found that some programs
and headers contain constructs like this:

-------------

#ifdef COMMENT

This is a really strange way to make a comment, wouldn't you say?

#endif

-------------

GCC will report an unterminated character constant in the code
fragment above, regardless of whether or not COMMENT is defined.
The fix is to turn this pseudo-comment into a real comment.

In some cases comments like the above also exist in code to force
deliberate errors if a certain required macro is not defined.

-------------

#ifndef MEM_SIZE

You forgot to define MEM_SIZE, didn't you?

#endif

-------------

Since this nasty device can appear in older (or just plain uglier)
source code, you may want to issue an anti-brain-damage warning in GCC
documentation.

					Frank