On Mon, 24 Jul 2000, Ury Segal wrote:
> b. If you ar not familiar with sscanf, how about fopen(), eh ? Old
> timer, mentioned in K&R. Even THIS has no standard. On most
> Windows/DOS compilers, if you does not use the letter "b" in the
> 2nd argument to open, it will add CRLF, or maybe CR, or maybe
> LD after evert 255, or 254 or 246 character without CR,or CRLF,
> or maybe LF, among them. It all depends on your compiler. This is
> the default behaviour which can be changed in diffrent way in
> different
> compilers. And you don't want to know about the read operation,
> belive
> me.
Umm..."b" is always supported, and the default mode is *always* text. It
just so happens that on UNIX, things happen to work even if you forget the
"b".
> 2) The "standard" C variables types
>
> *) Do you know what is the size of an int ? It is built-in into
> the language definition that you cannot know the size of an
> int variable. It cannot BE standartized. GREAT !
>
> *) Worse: Do you know the size of a pointer ? A long ? what
> ever compiler, or on some system, how you booted the machine,
> effect that.
There are standards for minimum length.
> *) Is the "long long" datatype signed or unsigned by default ?
> Can you read my the "standard" on this ?
"long long" isn't part of the C standard. It is part of the upcoming
C9x standard, however.
> 3) The "standard" C language Keywords
>
>
> *) Have you ever heard of the "far" keyword, sometimes used as the "FAR"
> macro? On 16 bit 8086 systems, it is used widely. Do you know how
> hard is this to go over 100's of 1000's of lines of "standard" C
> code
> and make it 32-bit with this used-to-be widely-used keyword
But "far" isn't part of the standard.
> *) "register" . Does anyone know what it does? It varies on different
> versions
> of the same compiler, for god's sake.
It does nothing semantically, except means it's illegal to take the
address.
The compiler can do whatever optimizations which do not affect semantics.
> 4) The "standard" C Preproccesor
>
> Don't get me started on this. Almost no two compiler has similar
> preprocessor. Multiple parameters to a macro with the same name?
> sometimes you have it, sometimes not.
It's illegal to do it. The C compiler can make demons come out of your
nose for all I care.
> and the "#pargma" directive,
> which makes sure that your code will not compile somewjere else,
> makes sure that you have to read ALL the manual of ALL the c
> compiler you are using.
Here's a simple solution: don't use "#pragma".
> And, I don't know why you guis like Standard so much. There
> is one language that have a full tandard: ADA.
There are many more: Common Lisp is standard, too, for example. If you're
not demanding ANSI standards, then you have Scheme (R5RS), and ECMAScript,
for example.
Standards are good, because code sometimes needs to be portable. The code
I write must compile on WinNT with MSVC 5.0 and 6.0, on Solaris with
SunWS 5.0, on AIX with Visual Age 5.0, and more porting requirements are
looming in the future. C++ does have a standard, but all compilers I
mentioned have too many parts they don't support that well. C, OTOH, is
pretty well implemented on all of them.
--
Moshe Zadka <[EMAIL PROTECTED]>
There is no IGLU cabal.
http://advogato.org/person/moshez
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]