News for hackers. Stuff that matters.
Re:What Every C Programmer Should Know About Undefined Behav... by buserror on Thursday January 05, 2017 @07:14AM (#13326513)
-Werror used to be the way to go, until compiler writers decided to add warnings for idiotic reasons.

Like 'confusing indentation' or 'unused static const variables'.

Seriously, these two are completely idiotic; why would the compiler decide that the fact I don't have a blank line 'might' be confusing? on whose criteria? Same with static const variables in C files. Lots of code is often #ifdef in/out, and lots of people would rather have a static const int than a #define!

Re:What Every C Programmer Should Know About Undefined Behav... by mattkrause on Thursday January 05, 2017 @09:03AM (#13327130)
The "confusing indentation" warning can be useful. For example, it would have flagged

  if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)

      goto fail;

      goto fail;
Does any compiler try to indicate the severity of each warning. For example, using the value from an uninitialized variable is labeled as somehow "worse" than code-quality warnings like indentation or bare assignments inside conditionals?