Re:My favorite C compiler flags during development
by tmtvl on Sunday April 30, 2023 @05:49AM
(#35761072)
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.:
And let downstream add their own flags (-Owhatever, -fsomething,...) on top of that.
[ Parent
| on HN ]
Re:My favorite C compiler flags during development
by rwmj on Sunday April 30, 2023 @06:28AM
(#35761247)
That's right. Fedora overrides a lot of flags globally, eg. adding -D_FORTIFY_SOURCE=3 and a bunch of other hardening stuff.
Re:My favorite C compiler flags during development
by injinj on Sunday April 30, 2023 @06:56AM
(#35761406)
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?
Re:My favorite C compiler flags during development
by account42 on Thursday May 04, 2023 @08:09AM
(#35814084)
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.