From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,31c0457c1c47fc2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-12 18:07:37 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn4feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail From: "David Thompson" Newsgroups: comp.lang.ada References: <27085883.0110191714.784d3d25@posting.google.com> <3BD7DD2B.A8FD8448@brighton.ac.uk> <3BD832AE.35A4B31B@sparc01.ftw.rsc.raytheon.com> <3BD8529B.71010C5B@sparc01.ftw.rsc.raytheon.com> Subject: Re: Have you ever had a bug OOPS X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Tue, 13 Nov 2001 02:07:37 GMT NNTP-Posting-Host: 12.89.171.190 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1005617257 12.89.171.190 (Tue, 13 Nov 2001 02:07:37 GMT) NNTP-Posting-Date: Tue, 13 Nov 2001 02:07:37 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:16388 Date: 2001-11-13T02:07:37+00:00 List-Id: Wes Groleau 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