Announcement

Collapse
No announcement yet.

GCC Unlikely To Adopt A "-Weverything" For Exposing All Possible Code Warnings

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by AHSauge View Post
    [...]Say what you want about packed structs, but in C they are sadly quite required in some context [...]
    Can you give examples? I've written countless drivers and other stuff for hardware that doesn't support unaligned accesses, but never once have I felt the need for a packed struct.

    Comment


    • #12
      Originally posted by bison View Post

      I use -Wall -Wextra, and sometimes that seems like too much -- you almost have to use -Wno-unused-parameter with anything that uses callback functions.
      You're right about callback functions using -Wall -Wextra but I consider these 2 options (and few others) are mandatory to catch potential bugs. Having -Weverything seems to be overkill but as it was said, if I'm not wrong, the purpose for developers is to use it from time to time to detect unexpected warnings (such option would have been useful for me in the past).

      Comment


      • #13
        Originally posted by brrrrttttt View Post
        I cannot forsee myself ever using this... does anyone that actually maintains a non-trivial piece of software want this?
        That sounded like "I have big, old, bloated codebase. I'm not mad enough to see all this $hit".
        As other explained some useful warnings are not reported by Wall or Wextra...

        Comment


        • #14
          That is dumb. The whole reason some warnings aren't in -Wall is because they are not always useful. All those that make sense everywhere should be in -Wall, or if you want to be in pedantic, and don't mind a few false positives, in -Wextra...

          Comment


          • #15
            Originally posted by bison View Post

            I use -Wall -Wextra, and sometimes that seems like too much -- you almost have to use -Wno-unused-parameter with anything that uses callback functions.
            Why? Just don't name parameters you don't use.. Can you give an example where -Wunused-parameter would give a false positive? I only ever disable it because some code (especially Google code) has unused parameters everywhere and don't care half their logic and parameters is long dead and now unused deadweight.

            Comment


            • #16
              Originally posted by Anty View Post
              That sounded like "I have big, old, bloated codebase. I'm not mad enough to see all this $hit".
              As other explained some useful warnings are not reported by Wall or Wextra...
              The amount of warnings printed during Linux kernel compile is... significant. I would not assume anything about his codebase.

              Comment


              • #17
                Just tried -Weverything on valid C++17 code. It throws tens of...

                incompatible with C++98 [-Wc++98-compat]

                warnings. The same code compiles without any diagnostic messages with -Wall -Wextra -Wpedantic -Wconversion -Weffc++. In fact, the lack of retro-compatibility is the only kind of warning issued, repeated again and again and again.

                Now, this is sufficient for me to deem it useless, unless I wanted to write in prehistoric C++98...

                Comment


                • #18
                  Yet another GNU project whose devs wouldn't understand a point if it stabbed them in the eye. Hurd, GNOME (GNU Network Object Model Environment, iirc), GNUStep (obsoleteish and nearly unmaintained), and now GCC. Or again, rather.

                  Just add the switch and document that it is only for devs. Autotag bugs as lowest priority. Done.

                  Comment


                  • #19
                    It's their decision but I personally like the idea of being able to specify -Weverything and then individually disable the specific warnings that I don't want. So it would effectively put GCC into a "all warnings by default" mode instead of a "no (or very few) warnings by default mode". So you have to toggle off options instead of toggle them on.

                    Comment


                    • #20
                      Originally posted by carewolf View Post

                      Why? Just don't name parameters you don't use.. Can you give an example where -Wunused-parameter would give a false positive? I only ever disable it because some code (especially Google code) has unused parameters everywhere and don't care half their logic and parameters is long dead and now unused deadweight.
                      I use it for temporarily disabling the error handler in Xlib. The API requires a display pointer parameter, so the options are 1) do some sort of no-op with the display pointer parameter to make the compiler shut up, or 2) use -Wunused-parameter.

                      Comment

                      Working...
                      X