From owner-freebsd-hackers Sun Jun 7 10:47:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA09502 for freebsd-hackers-outgoing; Sun, 7 Jun 1998 10:47:27 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from antipodes.cdrom.com (castles336.castles.com [208.214.167.36]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA09489 for ; Sun, 7 Jun 1998 10:47:19 -0700 (PDT) (envelope-from mike@antipodes.cdrom.com) Received: from antipodes.cdrom.com (localhost [127.0.0.1]) by antipodes.cdrom.com (8.8.8/8.8.5) with ESMTP id JAA06549; Sun, 7 Jun 1998 09:42:44 -0700 (PDT) Message-Id: <199806071642.JAA06549@antipodes.cdrom.com> X-Mailer: exmh version 2.0zeta 7/24/97 To: joelh@gnu.org cc: hackers@FreeBSD.ORG Subject: Re: Irritating cpp feature In-reply-to: Your message of "Sun, 07 Jun 1998 11:40:15 CDT." <199806071640.LAA17751@detlev.UUCP> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 07 Jun 1998 09:42:43 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > I'm coming across an irritating cpp feature trying to port a large body > > of foreign code; namely: > > #if 0 > > This is pointless text with one of ' in it. > > #endif > > Despite the #if-fing out, the quote is still parsed. Unfortunately, > > this conflicts with a substantial body of #if'd documentation, which > > contains (you guessed it) more comment delimiters. > > The code obviously builds OK on other gcc-wielding platforms; is there > > something funny about our preprocessor? > > According to ANSI C, anything in an #if / #endif must still be, up to > a point, valid C syntax. The fact that most preprocessors assume that > all quotes are matched is irrelevant. I hate to break it to you, > Mike, but it's invalid code. Now, that said, I'll look at fixing your > problem. :-) This is the least of my quibbles with the quality of the code in question, but I don't have the time to get too carried away "fixing" a source tree that bulks over 500MB. > Are you using the same version of gcc on said other gcc-wielding > platforms? I wouldn't be suprised if cpp has changed in the interim. The code is known to build on current Linux systems. The cpp barfage comes from 'cc -E', being invoked by a (their) custom prototype generator. It sounds like I can just tweak the cpp invocation to suppress this (it may also deal with the '...' construct in similar circumstances causing problems). > Depending on the code, it may be trivial to write a quick sed/awk/perl > script to mung it into conformity. (I wouldn't mind taking that on as > an exercise myself if you're busy; I might have use for it elsewhere.) If I were to do that, my chances of ever having the port enter their mainstream would be absolutely zero. 8( -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message