Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


I 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.


The 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.


fair point


This 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.


There 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.


That's right. Fedora overrides a lot of flags globally, eg. adding -D_FORTIFY_SOURCE=3 and a bunch of other hardening stuff.


That'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?




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: