From owner-freebsd-hackers Sun Jun 7 09:11:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA21724 for freebsd-hackers-outgoing; Sun, 7 Jun 1998 09:11:43 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from awfulhak.org (awfulhak.force9.co.uk [195.166.136.63]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA21619 for ; Sun, 7 Jun 1998 09:11:04 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from gate.lan.awfulhak.org (localhost [127.0.0.1]) by awfulhak.org (8.8.8/8.8.8) with ESMTP id PAA10140; Sun, 7 Jun 1998 15:53:11 +0100 (BST) (envelope-from brian@gate.lan.awfulhak.org) Message-Id: <199806071453.PAA10140@awfulhak.org> X-Mailer: exmh version 2.0.1 12/23/97 To: Mike Smith cc: hackers@FreeBSD.ORG Subject: Re: Irritating cpp feature In-reply-to: Your message of "Sun, 07 Jun 1998 00:53:48 PDT." <199806070753.AAA04355@antipodes.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 07 Jun 1998 15:53:11 +0100 From: Brian Somers 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? I've seen this before.... it caused me a lot of problems when I first used (IRRC) version 2.7.*. I wrote a script to parse ~400000 lines of code and change the ' to a ", rebuilt and the problem went away. I thought it happened only for // This code isn't here Afterwards, I realised that I'd made a mistake in the script and missed a load of should-be-offenders.... but they compiled correctly ! I never got 'round to figuring out what exactly was going on (I got permanently side-tracked in a new job), but it wasn't easily reproducible :-( > -- > \\ 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 -- Brian , , Don't _EVER_ lose your sense of humour.... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message