delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/15/11:40:35

From: "Ben Davis" <ben AT vjpoole DOT freeserve DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Possible GCC Bug
Date: Sat, 15 Apr 2000 16:38:07 +0100
Organization: Customer of Planet Online
Lines: 27
Message-ID: <8da2fg$3uu$1@newsg4.svr.pol.co.uk>
References: <000f01bfa673$a9e573e0$0100a8c0 AT amanda>
NNTP-Posting-Host: modem-40.anadrol.dialup.pol.co.uk
X-Trace: newsg4.svr.pol.co.uk 955813168 4062 62.136.79.40 (15 Apr 2000 15:39:28 GMT)
NNTP-Posting-Date: 15 Apr 2000 15:39:28 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

>> In the above snippet of code, the second group of  bytes has a row
missing when
>> compiled.. To correct it I have to write the first line as follows:
>>
>> 0xff, // 00000000  // '\'
>>
>> I think gcc's scanner is interpreting the slash as a special character,
rather than just
>> skipping it as it should as it is part of a single line comment.

I'm far from an expert on what is the correct C standard, but I don't think
this is a bug. It is normal in #define macros to use backslashes to span
lines. The \(enter) sequence does not count as a new line to the compiler,
in the same way that \n has a special meaning in a string.

Whether this is also supposed to be true for comments, I don't know. But
RHIDE seems to agree with GCC here. If you have enabled syntax highlighting
in RHIDE, you will notice that it actually highlights the next line as a
comment as well.

By the way, don't type spaces after a backslash without typing something
after the spaces. RHIDE has a habit of (usually) deleting them and (always)
pretending they're not there (when you press End).

Ben Davis


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019