News for hackers. Stuff that matters.
Re:Deep C by Dylan16807 on Tuesday October 11, 2011 @02:48PM (#3099801)
I'm actually worried the girl's going to shoot herself in the leg.

  void foo(void)
  {
    int a = 41;
    a = a++;
    printf("%d\n", a);
  }
She says 'a gets an undefined value' but that's not true at all. There are compilers that will look at that undefined function and omit the entire body, including the print.

It is extremely important to understand that undefined behavior can and will break everything, even if it appears to be behaving whenever you look.

There are no comments on this comment yet.