What does the compiler think I am doing here? (C bite?)

Dick Dunn rcd at opus.UUCP
Wed Sep 11 14:07:28 AEST 1985


> [ The discussion concerns putting statements like ``37;'' into your C
> code.  I'm addressing the claim that no known compilers will generate
> code for this statement. ]
> 
> Well, I once worked with a C compiler on a 68000 which interpreted
> statements consisting of a single number as 68K code.  It was really
> great!  You get stuff which looks like this:
> ...
> 	0x00ff12;
> ...

Great?  Well, it's cute, but the compiler is dead wrong...it's a pretty
radical change to C's semantics.  (Gee, I wonder if an expression like
"i+j;" would compute the sum, store it, and execute the result?:-)
Seems to me that this little extension could get into a dandy fight with
some obscure macros and a clever optimizer.  Aaaack.

> And so forth.  There was even a kernel include file which declared
> spl0 & co. like this:
> 
> 	#define spl0()	0x0012345
> ...(or whatever)

"And so forth"???  Sounds a bit like Forth, right?!  (but certainly not
forthright...)
-- 
Dick Dunn	{hao,ucbvax,allegra}!nbires!rcd		(303)444-5710 x3086
   ...Relax...don't worry...have a homebrew.



More information about the Comp.lang.c mailing list