2 ms·
Yes, but don't turn it on except in developer builds. For downstream packagers it's a pain if a newer compiler adds a warning which then breaks the build.
by rwmj 4y ago
Yes, but don't turn it on except in developer builds. For downstream packagers it's a pain if a newer compiler adds a warning which then breaks the build.
- DyslexicAtheist 4y agoI see your point, and agree it might be painful. it depends on the promises the maintainer makes to themselves and to their users. I'd rather break the build and get immediately alerted by (hopefully moderately) upset downstream packagers than having this warning become visible in my users builds. It isn't just about getting rid of a warning, but the new compiler has changed some important logic so this warning might highlight potentially undefined behavior. Am I, the maintainer OK with that - that is the main question I believe. Might be useful to do regression with any new compiler being released especially when a product is used in safety or security critical systems.
- rwmj 4y agoThe trouble is a downstream packager might be compiling the whole distro -- 1000s of packages -- and they're not in a position to fix a new warning somewhere deep inside a program they don't know and probably don't use. They are more likely to hack the build system to add -Wno-error while cursing the upstream project.
- DyslexicAtheist 4y agofair point
- tmtvl 4y agoThis may be a controversial statement, but I don't think projects should distribute any flags aside from the bare minimum to get everything working. E.g.: -std=c17 -lm And let downstream add their own flags (-Owhatever, -fsomething,...) on top of that.
- rwmj 4y agoThat's right. Fedora overrides a lot of flags globally, eg. adding -D_FORTIFY_SOURCE=3 and a bunch of other hardening stuff.
- injinj 4y agoThat's new. Wow, latest has -mno-omit-leaf-frame-pointer (rpm --eval '%{optflags}') Do you know of a way to get rpmbuild to keep the -ffat-lto-objects in the ar libs?
- account42 4y agoThere are many more flags such as -ffast-math where the project will be better positioned to decide if they make sense than some random packager juggling hundreds of packages. Even for optimzation flags that don't change behavior there is no clear best set of flags that you should blindly apply to all projects.