🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Frank Wortner Tue, 20 Sep 1988 16:12
Problem Compiling Certain Bad C Code
#1717
Author: Frank Wortner
Date: Tue, 20 Sep 1988 16:12
37 lines
1418 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads