Sep. 16th, 2019

c wtf

Sep. 16th, 2019 11:13 am
juan_gandhi: (Default)

Reading this book: https://www.oreilly.com/library/view/programming-rust/9781491927274/ch01.html

It says:
 

Consider the following C program:

int main(int argc, char **argv) {
  unsigned long a[1];
  a[3] = 0x7ffff7b36cebUL;
  return 0;
}

According to C99, because this program accesses an element off the end of the array a, its behavior is undefined, meaning that it can do anything whatsoever. When we ran this program on Jim’s laptop, it produced the following output:

undef: Error: .netrc file is readable by others.
undef: Remove password or make file unreadable by others.

Then it crashed. Jim’s laptop doesn’t even have a .netrc file. If you try it yourself, it will probably do something entirely different. 

juan_gandhi: (Default)
 Вылечились уже? Вот мне как-то не на 100% верится. На 80%, может быть. Но не на 100%

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

November 2025

S M T W T F S
       1
23456 7 8
9 1011 12 131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Nov. 15th, 2025 08:54 pm
Powered by Dreamwidth Studios