From owner-freebsd-hackers Sun Jun 7 09:27:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA24902 for freebsd-hackers-outgoing; Sun, 7 Jun 1998 09:27:46 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from hda.hda.com (hda-bicnet.bicnet.net [208.220.66.37]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA24785 for ; Sun, 7 Jun 1998 09:26:47 -0700 (PDT) (envelope-from dufault@hda.hda.com) Received: (from dufault@localhost) by hda.hda.com (8.8.5/8.8.5) id MAA13243; Sun, 7 Jun 1998 12:01:54 -0400 (EDT) From: Peter Dufault Message-Id: <199806071601.MAA13243@hda.hda.com> Subject: Re: Irritating cpp feature In-Reply-To: <002301bd9225$f1527480$804106d1@micron> from Gregory D Moncreaff at "Jun 7, 98 11:07:07 am" To: moncrg@ma.ultranet.com (Gregory D Moncreaff) Date: Sun, 7 Jun 1998 12:01:54 -0400 (EDT) Cc: mph@pobox.com, mike@smith.net.au, hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > you can put anything you want in an #if 0/#endif block. > by definition, the preprocessor deletes such before the compiler > (which is the only thing that checks code syntax) > even sees it Not true according to info gcc. However, -traditional works around it: * GNU CC complains about unterminated character constants inside of preprocessing conditionals that fail. Some programs have English comments enclosed in conditionals that are guaranteed to fail; if these comments contain apostrophes, GNU CC will probably report an error. For example, this code would produce an error: #if 0 You can't expect this to work. #endif The best solution to such a problem is to put the text into an actual C comment delimited by `/*...*/'. However, `-traditional' suppresses these error messages. Peter -- Peter Dufault (dufault@hda.com) Realtime development, Machine control, HD Associates, Inc. Safety critical systems, Agency approval To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message