Y
Hacker News
new
|
ask
|
show
|
jobs
by
aidenn0
5131 days ago
Not true, !0 is always 1 in the C standard. Other parts are wrong though (they assume short is narrower than int, and that int is 32 bits).
3 comments
chc
5131 days ago
It's not wrong. If you read the intro, they note that those traits are implementation defined, so they say to assume you're using an implementation with those characteristics.
link
nooop
5131 days ago
So this is incorrectly titled. This should be a "A Quiz About Integers in C on common x86 and x64 ABI."
Unfortunately this does not educate people to that kind of issues, which is very unfortunate.
link
rcfox
5131 days ago
The assumptions are explicitly stated at the beginning of the quiz.
link
matzahboy
5131 days ago
Thanks. I didn't know that
link