u/obsessedcrf - 2 Archived Voat Posts in v/programming
u/obsessedcrf
  • home
  • search

u/obsessedcrf

0 posts · 2 comments · 2 total

Active in: v/programming (2)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Comment on: Linus Torvalds - "That is either genius, or a seriously diseased mind."

Did you read it? Linus explains it pretty well.

It depends on highly obscure behavior. If one of the pointer operators of the tertiary operator evaluates to integer constant NULL (0), then the return value of the tertiary operator is coerced to have the type of the non-null operator (which is int *). And of course sizeof(*(int *)1) == sizeof(int). It relies on the fact that if it isn't an ICE, x * 0 will not be evaluated as null (remember sizeof cannot execute code) and the tertiary operator return will fall back to being of type void *. And sizeof(*(void *)x) != sizeof(int)

Like Linus points out, this is bad bad. There is no standardization for the sizeof(*(void*)) and it may very well equal sizeof(int) in a different compiler or even a future version of GCC

0 30 Mar 2018 07:53 u/obsessedcrf in v/programming
Comment on: 2015's Most Popular Programming Language Was Good Old Java

That's a shame

3 10 Jan 2016 12:27 u/obsessedcrf in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.