Name: Anonymous 2014-04-27 16:07
#include <stdio.h>
int main(int argc, char** argv) {
int i = i;
printf("%d\n", i);
return 0;
}
I guess I shouldn't be surprised, but this is a bit of a jolt after using
let
.
#include <stdio.h>
int main(int argc, char** argv) {
int i = i;
printf("%d\n", i);
return 0;
}
let
. gcc -g -gdwarf-4 -Og -Wall -Wextra --std=c11 -Wpedantic -Wno-empty-body -Wno-unused-parameter -fno-diagnostics-show-caret -fsanitize=address -fno-omit-frame-pointer -Wno-unused-function -pthread -lpthread -D_XOPEN_SOURCE=700 -Werror *.c
gcc -lorem -ipsum -dolor -sit -amet -consectetuer -adipiscing -elit -sed -diam -nonummy -nibh -euismod=tincidunt -ut=laoreet -dolore -magna -aliquam -erat -volutpat -wisi -enim -ad -minim -veniam -quis -nostrud -exerci -tation=ullamcorper -suscipit -lobortis -nisl -ex -ea -commodo -consequat -duis -autem -vel -eum -iriure -dolor -hendrerit -vulputate -velit -esse -molestie -consequat -vel -illum -dolore -feugiat -nulla -facilisis -vero -eros -accumsan -iusto -odio -dignissim -qui -blandit -praesent -luptatum -zzril -delenit -augue=duis -dolore -te=feugait -nulla -facilisi
send(to, from, count)
register short *to, *from;
register count;
{
register n=(count+7)/8;
switch(count%8){
case 0: do{ *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
}while(--n>0);
}
}
y f = let x = f x in x
#include <stdio.h>
int main(int argc, char** argv) {
unsigned i;
i ^= i;
printf("%u\n", i);
return 0;
}
i
may not actually be allocated by the time it is read for the first time (i ^=
i
) -- the compiler might decide that stuff should be allocated (lazily) at initialization and not at declaration and since i
is never initialized it might never be allocated. I can't find this in DA STANDARD right now, though, so correct me if I'm wrong.