volitile

Ray Butterworth rbutterworth at watmath.waterloo.edu
Sat May 21 02:56:56 AEST 1988


In article <502 at wsccs.UUCP>, terry at wsccs.UUCP (Every system needs one) writes:
>   Yes, but why is
> 
>       volitile int foo;
> 
>   better than
> 
>       int foo;    /* VOLITILE*/
> 
>   Except for the optimizer?

It's a lot better simply because "volitile int foo;" will cause the
compiler to generate a syntax error message, while "/*VOLITILE*/"
will be silently ignored.

Saying that you might make typos in news articles but never in
your code isn't good enough.  I make spelling mistakes in both,
and while people reading my articles can correct or ignore them,
I really appreciate it when the compiler notices and complains.

Any system, such as lint's "/*directive*/" or C's "#pragma directive",
that silently ignores the dyrective if it is misspelled is potentially
dangerous.



More information about the Comp.lang.c mailing list