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: References: <17d4b525-2c31-4c20-b3c5-a7118343e9a5 AT googlegroups DOT com> NNTP-Posting-Host: 65.13.115.246 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 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: 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 Content-Transfer-Encoding: 8bit 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 Precedence: bulk Hi, On Friday, July 20, 2012 6:20:19 PM UTC-5, Rod Pemberton wrote: > "K.J.Williams" <lord DOT DOT DOT AT gmail DOT com> wrote in message > news:17d4b525-2c31-4c20-b3c5-a7118343e9a5 AT googlegroups DOT com... > > > > //in myfile1.c > > > > short int myfunc(char x) > > { > > char w[0] = x; > > // legal in TC++ - but illegal in DJGPP, to assign the address > > // of x to w[0] in this manner > > It'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.