Mail Archives: djgpp/2012/07/21/11:00:23
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.
- Raw text -