if ( fread(fp, 1, size, fp) != size ) Oh so that's why my code is behaving wrong. Curiously I was reading /dev/urandom and expected random buffer contents, but not undefined behavior.
Unused arg happened to work here but it doesn't in general and it's usually a spam warning. Restrict violation would be a much more useful one.
-
-
Unused warnings have saved me many times. I agree it's more common that variables are ignored on purpose, but I find it worth the cost to add a (void) cast on them. Restrict warnings interest me.
-
I find unused warnings very useful too - even if the issue isn't serious, it's almost always something I want to fix. But yes, restrict warnings would be awesome.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.