Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What will this C code do?

Name: Anonymous 2012-01-19 8:24

void main(){
int x=1;
printf("%d\n",x=2);
}

Name: ‮ tegdim latnem ‭Anonymous 2012-01-20 19:31

>>36-37
While I agree that the current GNOME developers may be likened to a bunch of smoking cigarettes, my statement is stronger; I am stating that the root of the problem is the language itself. You don't see people writing HTML engines in assembly -- "of course not, that would be error prone (therefore possibly introducing security flaws) and rather masochistic". Then why do you see people writing such complex things in a language that is merely one thin layer of abstraction over assembly language?

Nay, C was meant to be portable assembly, and it was meant to be used for small programs like bootloaders or parts of OS kernels. And in this context, it's a bit hard to assume that chars don't have a certain size, or to respect strict aliasing given the crazy amount of casts that are to be done.

Oh and don't bother arguing that C is defined in terms of the C abstract machine and therefore has no relationship with assembly. The reason C is so useful is exactly because its popular implementations interface and integrate so well with assembly code and with the underlying machine, thereby yielding very efficient code. A C implementation that would just stick to the letter of the standard and specify nor allow anything else would be quite very pointless. C is not a great language. It's really the compilers that make it worth it.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List