News for hackers. Stuff that matters.
Re:Useful GCC warning options not enabled by -Wall -Wextra by slavik81 on Wednesday October 04, 2017 @04:46PM (#15404469)
I used to have it on by default, but I found it getting in my way while developing. I'd do things like add some temporary debug code, or comment out part of an algorithm and then end up with a bunch of compile errors to fix. The compiler rightly points out that the code is of poor quality, but that's because I'm not done yet.

Warnings in that case are still useful. If the project is otherwise warning-free then it's easy enough to spot the new warnings and judge if they represent a real mistake.

My preference today is to set -Werror on CI builds. Any code that's final should be warning-free, but it's unnecessarily painful for work-in-progress.

Re:Useful GCC warning options not enabled by -Wall -Wextra by quotemstr on Wednesday October 04, 2017 @04:57PM (#15404576)
In Java, the compiler complains about unreachable code and aborts. I think that's ridiculous. Sometimes it's useful to create unreachable code during development.

  int foo = doSomething();
  return 0;  // Debug XXX DONOTSUBMIT
  int bar = doSomethingElse();
  return foo + bar;
It's hilarious, though, that this workaround works:

  int foo = doSomething();
  if (1 > 0) return 0;  // Debug XXX DONOTSUBMIT
  int bar = doSomethingElse();
  return foo + bar;
Go's mandatory warnings are equally annoying. I'm sick and tired of little rarefied groups of language designers trying to impose their ideas about best practices on the rest of the world.
Re:Useful GCC warning options not enabled by -Wall -Wextra by wruza on Wednesday October 04, 2017 @05:53PM (#15405047)
What did you expect from a language that dictates to where to put your opening brace.
Re:Useful GCC warning options not enabled by -Wall -Wextra by vkou on Wednesday October 04, 2017 @08:34PM (#15405978)
What? That's a common style choice, not a language requirement.
Re:Useful GCC warning options not enabled by -Wall -Wextra by ameliaquining on Wednesday October 04, 2017 @11:29PM (#15406526)
You can't put the opening brace of a block on a separate line in Go, because the parser will insert a semicolon before it.
Re:Useful GCC warning options not enabled by -Wall -Wextra by vkou on Thursday October 05, 2017 @02:54AM (#15407112)
Sorry - I thought the conversation was about Java.