Prev: System Calls
Next: Warning to newbies
From: Mensanator on 19 Mar 2010 13:34 On Mar 19, 7:57 am, jmfbahciv <jmfbahciv(a)aol> wrote: > Mensanator wrote: > > On Mar 18, 6:09 pm, Larry__Weiss <l...(a)airmail.net> wrote: > >> Mensanator wrote: > >>> On Mar 18, 2:43 pm, Keith Thompson <ks...(a)mib.org> wrote: > >>>> BruceS <bruce...(a)hotmail.com> writes: > >>>> [...] > >>>>> <OT> AIUI, C++ accepts /* */ multiline comments without artificially > >>>>> terminating said comments at the end of line. I don't have a C++ > >>>>> Standard in front of me, so I can't confirm that it isn't simply an > >>>>> artifact of environments in which I've written C++, but I'm relatively > >>>>> confident that these work the same as in C. </OT> > >>>> In both C and C++, a comment that begins with /* is not > >>>> "artificially" terminated at the end of the line. Instead, it's > >>>> "artificially" terminated by the next */. (In other words, I'm > >>>> not sure what's so artificial about it.) > >>>>> According to The C Standard, 6.4.9p2, C allows comments that *do* > >>>>> automatically terminate at the end of the line, just as this style of > >>>>> comment works in C++. > >>>> [...] > >>>> Yes, both C and C++ now permit comments introduced by // and > >>>> terminated by the end of the line. These were introduced in BCPL, > >>>> one of C's distant ancestors from the 1960s. But they were dropped > >>>> from C, and only reintroduced by the 1999 ISO C standard (which > >>>> superseded the 1990 ISO C standard, which itself superseded the > >>>> de facto standard of Kernighan & Ritchie's book). C++ has always > >>>> supported // comments. > >>>> Today, most C compilers fully support at least the C90 standard, > >>>> but only a subset of the C99 standard. // comments are very widely > >>>> supported. On the other hand, they can be rejected if you choose > >>>> to invoke your C compiler in a strict C90-conforming mode, or if > >>>> you're using a sufficiently old compiler, so /*...*/ comments are > >>>> arguably more portable. // comments can also cause problems in > >>>> Usenet posts; implicit line wrapping can introduce syntax errors. > >>>> (Most people here in comp.lang.c already know this stuff; I'm posting > >>>> it mostly for the benefit of those in alt.folklore.computers > >>> Hey! Some of us folklorists actually DO know how to program. > >> At least we think we remember that we know how to program. > >> And some of us still demonstrate it by actually programming from time to time. > > >> Some of us wonder why we need all of these languages... > >> http://en.wikipedia.org/wiki/List_of_programming_languages > > > Oo, they even got Seed7 listed. > > > Would you believe Seed7 actually has a function named "bigCLit"? > > (Perhaps the author isn't up on American slang. I know he's European > > because he spoke of not living on the same continent.) > > Big C Literal? No idea. I didn't write it, I'm just fingering it trying to help the author figure out why Seed7 won't compile on Mac OS 10.6. The problem is that Mac is now using a 64-bit processor, so things like "int" and "long int" changed meanings under the current C compiler. (The author is pissed that C compilers don't use constant names like Java so that "short int" is always 16 bits, "int" always 32, "long int" always 64, etc.). I don't blame him, if C wasn't so half- assed there wouldn't be a need for Seed7. So I've been putting in patches at the author's direction since he doesn't have a Mac he can try it on. Changing "long int" to "int" solved the Segment Fault caused by trying to parse BigIntegers, but apparently has hosed the pointers as some programs now compile but get a fault when executed. So we haven't licked it yet. > > /BAH
From: despen on 19 Mar 2010 15:29 Mensanator <mensanator(a)aol.com> writes: > On Mar 19, 7:57�am, jmfbahciv <jmfbahciv(a)aol> wrote: > > No idea. I didn't write it, I'm just fingering it trying to help > the author figure out why Seed7 won't compile on Mac OS 10.6. > The problem is that Mac is now using a 64-bit processor, so things > like "int" and "long int" changed meanings under the current C > compiler. (The author is pissed that C compilers don't use constant > names like Java so that "short int" is always 16 bits, "int" always > 32, > "long int" always 64, etc.). I don't blame him, if C wasn't so half- > assed > there wouldn't be a need for Seed7. So I've been putting in patches at > the author's direction since he doesn't have a Mac he can try it on. If you need ints of specific sizes sys/types.h contains all the int types you might want.
From: Keith Thompson on 19 Mar 2010 15:39 despen(a)verizon.net writes: [...] > If you need ints of specific sizes sys/types.h contains all the > int types you might want. sys/types.h is not defined by the C standard (it's probably POSIX). <stdint.h> is standard; it defines typedefs a variety of integer types of specified sizes. One drawback is that it's new in C99, and some compilers still might not support it. But even in that case, it's not too difficult to roll your own; see, for example, <http://www.lysator.liu.se/c/q8/index.html>. -- Keith Thompson (The_Other_Keith) kst-u(a)mib.org <http://www.ghoti.net/~kst> Nokia "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"
From: Mensanator on 19 Mar 2010 16:14 On Mar 19, 2:39 pm, Keith Thompson <ks...(a)mib.org> wrote: > des...(a)verizon.net writes: > > [...] > > > If you need ints of specific sizes sys/types.h contains all the > > int types you might want. > > sys/types.h is not defined by the C standard (it's probably POSIX). > > <stdint.h> is standard; it defines typedefs a variety of integer > types of specified sizes. One drawback is that it's new in C99, > and some compilers still might not support it. But even in that > case, it's not too difficult to roll your own; see, for example, > <http://www.lysator.liu.se/c/q8/index.html>. Well, I guess if it's not standard and the compiler doesn't support the things that are standard, we should not be too surprised that nothing works. The author said the next release was due Sunday and that all the types would be fixed by then. But he's been quiet for the last couple days. Perhaps he's bitten off more than he can chew. I suppose I'll find out Sunday. > > -- > Keith Thompson (The_Other_Keith) ks...(a)mib.org <http://www.ghoti.net/~kst> > Nokia > "We must do something. This is something. Therefore, we must do this." > -- Antony Jay and Jonathan Lynn, "Yes Minister"
From: Jeff Clough on 19 Mar 2010 19:12
>> >> I don't recognize the language, but it was originally posted only >> >> to alt.folklore.computers. Somebody decided to add a cross-post >> >> to comp.programming and comp.lang.c and didn't bother to mention it. >> >> > pascal uses := as an assignment operator >> >> But it doesn't use ; to introduce a comment. AutoHotKey uses both, but that's all I know about the language. http://en.wikipedia.org/wiki/AutoHotkey Jeff |