comp.lang.ada
 help / color / mirror / Atom feed
From: "David Thompson" <david.thompson1@worldnet.att.net>
Subject: Re: Have you ever had a bug OOPS
Date: Tue, 13 Nov 2001 02:07:37 GMT
Date: 2001-11-13T02:07:37+00:00	[thread overview]
Message-ID: <Jf%H7.109775$WW.6591726@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 3BD8529B.71010C5B@sparc01.ftw.rsc.raytheon.com

Wes Groleau <wwgrol@sparc01.ftw.rsc.raytheon.com> wrote :
>
> Someone pointed out that I goofed in my C syntax.
> Here is the correction:
>
> > some_file.h, line 1537:
> >
> >    define THE_MAX = 100
> >
This still isn't valid.  You meant #define (optionally plus space).
And the bug is that you put an = between the identifier and
the intended value, which is correct for a regular variable
but not for the rather different preprocessor syntax.

> > my_file.c, line whatever:
...
> >    goal=THE_MAX; /* set a new goal */
>
> And just in case it's obscure, the point was
> that after preprocessing, the error in the header file
> means one loop never ends, the other is stopped immediately,
> and goal is unchanged.  Of course, the second loop has an error
> of its own or it would not compile.
>
Not in Standard C.  Some (not all) "K&R1" preprocessors
might join a source character to a macro expansion like that,
but the Standard prohibits it (except if you ask for it by using
the "paste" operator ## on tokens _within_ a macro body).

AIUI on some embedded systems you get really lame old
C implementations, which might still do this; but you might
get no Ada implementation at all, which is hardly better.

--
- David.Thompson 1 now at worldnet.att.net







      reply	other threads:[~2001-11-13  2:07 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-20  1:14 Have you ever had a bug caused by Mike Silva
2001-10-20  1:44 ` Larry Kilgallen
2001-10-20  2:12   ` James Rogers
2001-10-20  9:15     ` Robert*
2001-10-20 11:20       ` Bertrand Augereau
2001-10-20 11:30         ` Matthew Woodcraft
2001-10-20 12:39           ` Robert*
2001-10-20 13:09           ` Bertrand Augereau
2001-10-20 21:21         ` Robert Dewar
2001-10-22 15:58     ` Ted Dennison
2001-10-20 19:07 ` Dr Adrian Wrigley
2001-10-21  1:09   ` Mike Silva
2001-10-21 12:05     ` Larry Kilgallen
2001-10-22 14:48 ` Marin David Condic
2001-10-22 17:03   ` Martin Dowie
2001-10-22 17:22     ` Marin David Condic
2001-10-23  6:13   ` Mike Silva
2001-10-22 21:49 ` David Bolen
2001-10-22 22:14   ` Marin David Condic
2001-10-23  0:52     ` Robert*
2001-10-23 13:30       ` Marin David Condic
2001-10-25  9:45         ` John English
2001-10-25 15:23           ` Marin David Condic
2001-10-25 18:17             ` Ted Dennison
2001-10-25 15:36           ` Ted Dennison
2001-10-25 16:09       ` Simon Wright
2001-10-25  2:16     ` David Bolen
2001-10-23  6:26   ` Mike Silva
2001-10-23  9:40     ` mike
2001-10-23 10:09       ` Preben Randhol
2001-10-23 13:48         ` Marin David Condic
2001-10-23 15:45           ` Ted Dennison
2001-10-23 17:08             ` Marin David Condic
2001-12-04 11:09               ` Harri J Haataja
2001-10-24 12:44             ` Marc A. Criley
2001-10-24 18:55               ` Jeffrey Carter
2001-10-24 19:34                 ` Marin David Condic
2001-10-26  4:18                   ` (Off topic:) Quality Anders Wirzenius
2001-10-25  9:36 ` Have you ever had a bug caused by John English
2001-10-25 15:41   ` Wes Groleau
2001-10-25 17:57     ` Have you ever had a bug OOPS Wes Groleau
2001-11-13  2:07       ` David Thompson [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox