News for hackers. Stuff that matters.
Re:C, C++, x86/x64 assembly: The case of forgotten return by craftyguy on Friday December 14, 2018 @09:17PM (#18686622)
> Please, no, don't use ... when distributing your code

FTFY. It's fine to use them for development, but a major pain in the ass if you are distributing your code for others to compile (looking at you, google).

Re:C, C++, x86/x64 assembly: The case of forgotten return by mort96 on Friday December 14, 2018 @09:33PM (#18686688)
Yeah, I don't care how people or organizations actually write their code, I just want to download the code they distribute (through git or tarballs) and run the commands listed in a readme without the build failing because GCC thinks there's an unnecessary number of parentheses around an expression.

The three alternatives were meant as somthing easy one could do instead of blindly using using -Werror to achieve the same advantages, but there are of course more ways to do it.

I have also had the fortune of using Goole code. I have been meaning to write a blog post about the issues one encounters when using a Goole library without being a part of Google.

Re:C, C++, x86/x64 assembly: The case of forgotten return by ctrl_freak on Friday December 14, 2018 @11:29PM (#18687037)
I actually don't even like -Werror for development. When I'm developing/testing/debugging, I frequently want to run partially implemented functions (a good example of this is repeatedly commenting out blocks of code to bisect a problem). Trying to deal with warnings about unused variables/parameters is extremely cumbersome.
Re:C, C++, x86/x64 assembly: The case of forgotten return by MaulingMonkey on Saturday December 15, 2018 @04:49AM (#18687794)
I want to opt out of bad warnings-as-errors, rather than failing to opt into good ones. -Wall -Wextra -pedantic -Werror for me - followed by a bunch of -Wno-xyz like -Wno-unused-variable.

You could also use -Wno-error=unused-variable, but I find warnings as warnings almost completely pointless outside of extremely niche circumstances. I will lose them in a sea of other errors when a template goes awry, and after fixing that and building again the warning will disappear because the TU with said warning didn't need rebuilding.

Re:C, C++, x86/x64 assembly: The case of forgotten return by slavik81 on Saturday December 15, 2018 @01:48AM (#18687397)
I agree. The main place I find -Werror to be valuable is on the CI server, where you're checking that committed code compiles cleanly on your target platforms.
Re:C, C++, x86/x64 assembly: The case of forgotten return by uxp100 on Saturday December 15, 2018 @12:37AM (#18687234)
I like having a makefile variable such that you can do "make NO_WERROR=1"