4 ms·
>> It means your code may fail to compile on future compilers using your provided build scripts. Seems fishy. Changing compilers sounds like a hypothetical. If
by phkahler 5y ago
>> It means your code may fail to compile on future compilers using your provided build scripts.
Seems fishy. Changing compilers sounds like a hypothetical. If you know you're going to use say GCC on Linux, LLVM on maxOS, and MSVC on Windows then set that up and work through the problems. Otherwise, what future compiler change? Also, once all the warnings have been cleaned up there won't be that many when you change compiler.
- detaro 5y agoChanging compilers to future versions is not "a hypothetical" for the vast majority of software. > there won't be that many when you change compiler. When people build your software as a dependency, as in the parents example, any error you didn't cover yet is a problem.
- phkahler 5y ago>> When people build your software as a dependency... When your project is a dependency for others, I think you've got even more responsibility to use these flags and fix the issues. If not, you're denying your end users the ability to use those options for building their project. I'm looking at you GTK.
- detaro 5y agoOf course you should fix the issues. But you shouldn't have the build scripts etc you ship and that your users use trip them.
- acdha 5y ago> Changing compilers sounds like a hypothetical. How? It’s happened many times before – in the 90s, most people used the platform compilers; then most projects switched to GCC for {price,stability,features}; Mac developers flirted with things like xlc towards the end of the PowerPC era; lots of people switched to LLVM — many projects have scar tissue from those past transitions still scattered around their code and build scripts! Moreover, you will certainly be switching to newer versions of the same compiler. Your code might fine now but after the compiler team helpfully identifies additional areas for concern the same code will raise new warnings.
- flohofwoe 5y agoIf you're a library author you generally can't dictate what compiler to use (within reason of course). IME a surprisingly high number of people use MingW/GCC or Clang to build Windows projects for instance (and this works surprisingly well too). Also: new versions of the same compiler add new warnings, so you need to account for that anyway, unless you want to stick forever on an old compiler version (I've worked on projects where upgrading to a new compiler version was often delayed for exactly that reason).