delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2012/07/21/11:00:23

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: rugxulo AT gmail DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Upgrading from a bad C compiler
Date: Sat, 21 Jul 2012 07:40:47 -0700 (PDT)
Organization: http://groups.google.com
Lines: 37
Message-ID: <b1f8c389-45f4-43e4-9056-62fc50fc9462@googlegroups.com>
References: <17d4b525-2c31-4c20-b3c5-a7118343e9a5 AT googlegroups DOT com> <jucp01$p35$1 AT speranza DOT aioe DOT org>
NNTP-Posting-Host: 65.13.115.246
Mime-Version: 1.0
X-Trace: posting.google.com 1342881742 12244 127.0.0.1 (21 Jul 2012 14:42:22 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Sat, 21 Jul 2012 14:42:22 +0000 (UTC)
In-Reply-To: <jucp01$p35$1@speranza.aioe.org>
Complaints-To: groups-abuse AT google DOT com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=65.13.115.246;
posting-account=p5rsXQoAAAB8KPnVlgg9E_vlm2dvVhfO
User-Agent: G2/1.0
Bytes: 2610
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q6LF029V031426
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Hi,

On Friday, July 20, 2012 6:20:19 PM UTC-5, Rod Pemberton wrote:
> &quot;K.J.Williams&quot; &lt;lord DOT  DOT  DOT  AT gmail DOT com&gt; wrote in message
> news:17d4b525-2c31-4c20-b3c5-a7118343e9a5 AT googlegroups DOT com...
> &gt;
> &gt; //in myfile1.c
> &gt;
> &gt; short int myfunc(char x)
> &gt; {
> &gt;   char w[0] = x;
> &gt;     // legal in TC++ - but illegal in DJGPP, to assign the address
> &gt;     // of x to w[0] in this manner
> 
> It&#39;s \\ not // for C++ comments...

I think you woke up on the wrong side of the bed. :-)

c:\rugxulo\tmp>gcc -Wall -Wextra -std=c99 -pedantic tony.c
tony.c: In function 'main':
tony.c:6:1: error: stray '\' in program

It's not \\ but indeed // for C99 and C++. Granted, some languages might allow this. I know you like Forth, and while I can't test right now, I assume \\ is the same as \ there (line comment). Heck, even XPL0 recently added \\ to be line comment, but that's not typical, several others (e.g. Lua or Euphoria or Ada) use -- for that.

Actually, on another note, I'm now vaguely curious about sizeof(struct) and how alignment (esp. C11 stdalign crud or whatever) would affect that. I'm fiddling with it locally, no huge surprises found, but all it really proves is that I don't know much about various dialects of C.   ;-)

http://en.wikipedia.org/wiki/Sizeof

P.S. Apologies for the weird message formatting, the "new" Google Groups isn't very configurable and does some questionable things.

- Raw text -


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