• g++: What is complete set of options exactly refuse compiling when any

    From ??Jacek Marcin Jaworski??@3:633/10 to All on Mon Apr 27 17:22:41 2026
    Subject: g++: What is complete set of options exactly refuse compiling when any warning appear?

    Hello!

    I use that g++ options:

    -Wall -Werror -Wformat=2 -Wfatal-errors

    , but KDE seems to catch have many more warnings and refuse to compile them. What g++ options should I type in order to refuse compiling any warnings?

    --
    Have a nice day!
    Jacek Marcin Jaworski, Pruszcz Gd., woj. Pomorskie, Polska ??, EU ??;
    tel.: +48-609-170-742, najlepiej w godz.: 5:00-5:55 lub 16:00-17:25; <jmj@energokod.gda.pl>, gpg: 4A541AA7A6E872318B85D7F6A651CC39244B0BFA;
    Domowa s. WWW: <https://energokod.gda.pl>;
    Mini Netykieta: <https://energokod.gda.pl/MiniNetykieta.html>;
    Mailowa Samoobrona: <https://emailselfdefense.fsf.org/pl>.
    UWAGA:
    NIE ZACI?GAJ "UKRYTEGO D?UGU"! P?A? ZA PROG. FOSS I INFO. INTERNETOWE!
    CZYTAJ DARMOWY: "17. Raport Totaliztyczny - Patroni Kontra Bankierzy": <https://energokod.gda.pl/raporty-totaliztyczne/17.%20Patroni%20Kontra%20Bankierzy.pdf>

    --- PyGate Linux v1.5.14
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From ??Jacek Marcin Jaworski??@3:633/10 to All on Mon Apr 27 18:19:16 2026
    Subject: Re: g++: What is complete set of options exactly refuse compiling when any warning appear?

    W dniu 27.04.2026 oÿ17:22, ??Jacek Marcin Jaworski?? pisze:
    Hello!

    I use that g++ options:

    -Wall -Werror -Wformat=2 -Wfatal-errors

    , but KDE seems to catch have many more warnings and refuse to compile
    them.
    What g++ options should I type in order to refuse compiling any warnings?

    In the middle time I ask ChatGPT, and it give me some advises:

    -Wall -Wextra -Wpedantic -Werror -Wformat=2

    , but is this right?
    --
    Jacek Marcin Jaworski, Pruszcz Gd., woj. Pomorskie, Polska ??, EU ??;
    tel.: +48-609-170-742, najlepiej w godz.: 5:00-5:55 lub 16:00-17:25; <jmj@energokod.gda.pl>, gpg: 4A541AA7A6E872318B85D7F6A651CC39244B0BFA;
    Domowa s. WWW: <https://energokod.gda.pl>;
    Mini Netykieta: <https://energokod.gda.pl/MiniNetykieta.html>;
    Mailowa Samoobrona: <https://emailselfdefense.fsf.org/pl>.
    UWAGA:
    NIE ZACI?GAJ "UKRYTEGO D?UGU"! P?A? ZA PROG. FOSS I INFO. INTERNETOWE!
    CZYTAJ DARMOWY: "17. Raport Totaliztyczny - Patroni Kontra Bankierzy": <https://energokod.gda.pl/raporty-totaliztyczne/17.%20Patroni%20Kontra%20Bankierzy.pdf>


    --- PyGate Linux v1.5.14
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Sam@3:633/10 to All on Tue May 26 07:02:48 2026
    Subject: Re: g++: What is complete set of options exactly refuse compiling when any warning appear?

    ??Jacek Marcin Jaworski?? writes:

    Hello!

    I use that g++ options:

    -Wall -Werror -Wformat=2 -Wfatal-errors

    , but KDE seems to catch have many more warnings and refuse to compile them. What g++ options should I type in order to refuse compiling any warnings?

    It's not that -Werror doesn't catch all warnings, it's just that, by
    default, g++ historically did not warn about some things that it SHOULD be warnings. For example:

    -Wsuggest-override -Wreturn-type

    Older versions of gcc stayed silent here:

    class Data {

    public:
    Data();
    ~Data();
    };


    Data give_me_some_data(bool probably_crash)
    {
    if (!probably_crash)
    return Data{};
    }

    At least as of gcc 13 -Wreturn-type is enabled by default, apparently, but this wasn't the case with older versions. I'm still suspicious that gcc
    won't always warn about this situation, so I'm still explicitly passing in -Wreturn-type (together with -Werror).

    This shouldn't even be a warning, it should be an error. This is ill-formed. gcc is still dropping the ball, pedantically.

    --- PyGate Linux v1.5.15
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From ??Jacek Marcin Jaworski??@3:633/10 to All on Tue May 26 13:28:58 2026
    Subject: Re: g++: What is complete set of options exactly refuse compiling when any warning appear?

    W dniu 26.05.2026 oÿ13:02, Sam pisze:
    ??Jacek Marcin Jaworski?? writes:

    Hello!

    I use that g++ options:

    -Wall -Werror -Wformat=2 -Wfatal-errors

    , but KDE seems to catch have many more warnings and refuse to compile
    them.
    What g++ options should I type in order to refuse compiling any warnings?


    At least as of gcc 13 -Wreturn-type is enabled by default, apparently,
    but this wasn't the case with older versions. I'm still suspicious that
    gcc won't always warn about this situation, so I'm still explicitly
    passing in -Wreturn-type (together with -Werror).

    This shouldn't even be a warning, it should be an error. This is ill- formed. gcc is still dropping the ball, pedantically.

    Thanx! In the past, several times I missing return value in my code, and
    that cause spurious, and hard to debug, crashes in my programs. Your
    advice is very valuable because I still use old:

    $ gcc --version
    gcc (Ubuntu 9.4.0-1ubuntu1~20.04.3) 9.4.0

    --
    Z totaliztycznym salutem!
    Jacek Marcin Jaworski, Pruszcz Gd., woj. Pomorskie, Polska ??, UE ??;
    tel.: +48-609-170-742, najlepiej w godz.: 5:00-5:55 lub 16:00-17:25; <jmj@energokod.gda.pl>, gpg: 4A541AA7A6E872318B85D7F6A651CC39244B0BFA;
    Domowa s. WWW: <https://energokod.gda.pl>;
    Mini Netykieta: <https://energokod.gda.pl/MiniNetykieta.html>;
    Mailowa Samoobrona: <https://emailselfdefense.fsf.org/pl>.
    UWAGA:
    NIE ZACI?GAJ "UKRYTEGO D?UGU"! P?A? ZA PROG. FOSS I INFO. INTERNETOWE!
    CZYTAJ DARMOWY: "17. Raport Totaliztyczny - Patroni Kontra Bankierzy": <https://energokod.gda.pl/raporty-totaliztyczne/17.%20Patroni%20Kontra%20Bankierzy.pdf>

    --- PyGate Linux v1.5.15
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)