|
|
Subscribe / Log in / New account

Modern C for Fedora (and the world)

Modern C for Fedora (and the world)

Posted Dec 9, 2023 22:42 UTC (Sat) by quotemstr (subscriber, #45331)
In reply to: Modern C for Fedora (and the world) by roc
Parent article: Modern C for Fedora (and the world)

What we really need is a date- or release-based -Wall. For example, one might write -Wall=gcc-12 and get all the warnings enabled with -Wall in GCC 12 and not any additional warnings GCC 13 might introduce. You could safely combine -Werror with -Wall this way.


to post comments

Modern C for Fedora (and the world)

Posted Dec 10, 2023 11:25 UTC (Sun) by joib (subscriber, #8541) [Link]

It might *help*, but it's probably not foolproof either, as a newer GCC release might have improved the -Wfoo diagnostics path to catch cases that the older release didn't catch. Of course you could, in principle at least, split the enhanced version into a separate -Wfoo-gcc-XY, or something like that, which is only activated when -Wall=gcc-XX isn't enabled. But I suspect GCC wouldn't want to commit itself to such a level of backward compatibility in the warnings. And of course if there's ever any refactoring of some particular warning, requiring to provide perfect backward compatibility for the previous 27 major releases would probably be prohibitive.

Modern C for Fedora (and the world)

Posted Dec 14, 2023 12:04 UTC (Thu) by spacefrogg (subscriber, #119608) [Link]

This is trivial to achieve. Just record the GCC version in your build scripts and set -Wall, when it updates. Then, update the recorded version once you are satisfied. This doesn't need any upstream support.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds