• g++: What command line option allow me to get the most friendly/respons

    From ??Jacek Marcin Jaworski??@3:633/10 to All on Mon Apr 27 17:27:44 2026
    Subject: g++: What command line option allow me to get the most friendly/responsive compiling error message?

    Hello!

    What g++ command line option allow me to get the most
    friendly/responsive compiling error message? I use:

    -Wformat=2

    which is not very friendly.

    --
    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 Michael S@3:633/10 to All on Mon Apr 27 18:43:33 2026
    Subject: Re: g++: What command line option allow me to get the most friendly/responsive compiling error message?

    On Mon, 27 Apr 2026 17:27:44 +0200
    ??Jacek Marcin Jaworski?? <jmj@
    energokod.gda.pl> wrote:

    Hello!

    What g++ command line option allow me to get the most
    friendly/responsive compiling error message? I use:

    -Wformat=2

    which is not very friendly.


    Friendly is in the eye of beholder.

    Responsive? That I don't understand at all. What exactly do you mean by
    that?

    -Wformat=2 influences warnings related to format specifiers in printf
    family. It has no effect on the rest of the warnings and certainly has
    no effect on error messages.

    BTW, docs are here: https://gcc.gnu.org/onlinedocs/gcc-15.2.0/gcc/Warning-Options.html


    --- 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:20:09 2026
    Subject: Re: g++: What command line option allow me to get the most friendly/responsive compiling error message?

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

    What g++ command line option allow me to get the most
    friendly/responsive compiling error message? I use:

    -Wformat=2

    which is not very friendly.

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

    -fdiagnostics-color=always -fdiagnostics-show-caret
    -fdiagnostics-show-option -fdiagnostics-show-template-tree -fmax-errors=5

    , but is this optimal?

    --
    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 Michael S@3:633/10 to All on Mon Apr 27 19:29:49 2026
    Subject: Re: g++: What command line option allow me to get the most friendly/responsive compiling error message?

    On Mon, 27 Apr 2026 18:20:09 +0200
    ??Jacek Marcin Jaworski?? <jmj@
    energokod.gda.pl> wrote:

    W dniu 27.04.2026 oÿ17:27, ??Jacek Marcin Jawo
    rski?? pisze:
    Hello!

    What g++ command line option allow me to get the most
    friendly/responsive compiling error message? I use:

    -Wformat=2

    which is not very friendly.

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

    -fdiagnostics-color=always -fdiagnostics-show-caret -fdiagnostics-show-option -fdiagnostics-show-template-tree
    -fmax-errors=5

    , but is this optimal?


    Your questions are impossible to answer before you explain to us what do
    you want.
    And no, "friendly", "responsive" and "optimal" are not explanations.

    The best use of chat bot would be to ask it to translate your very
    detailed wishes from Polish to English. Then ask it translate back from
    English to Polish, fix parts you are not happy about and repeat this
    loop until satisfied.
    Then come here with last translated variant.




    --- PyGate Linux v1.5.14
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Scott Lurndal@3:633/10 to All on Mon Apr 27 18:53:36 2026
    Subject: Re: g++: What command line option allow me to get the most friendly/responsive compiling error message?

    =?UTF-8?B?8J+HtfCfh7FKYWNlayBNYXJjaW4gSmF3b3Jza2nwn4e18J+HsQ==?= <jmj@energokod.gda.pl> writes:
    W dniu 27.04.2026 oÿ17:27, ??Jacek Marcin Jaworski?? pisze:
    Hello!

    What g++ command line option allow me to get the most
    friendly/responsive compiling error message? I use:

    -Wformat=2

    which is not very friendly.

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

    -fdiagnostics-color=always -fdiagnostics-show-caret >-fdiagnostics-show-option -fdiagnostics-show-template-tree -fmax-errors=5

    , but is this optimal?

    Optimal is the set of options that reduce the number of
    lines of diagnostic per detected syntax error to exactly one.

    Every release, gcc gets more verbose, and multiple
    diagnostic lines per error are very annoying.

    CFLAGS += -fno-diagnostics-show-caret
    CFLAGS += -fno-diagnostics-show-option

    at a minimum.

    I prefer -Wformat=1, to avoid spurious warnings when the
    format string is not a string constant, yet is completely under
    control of the application (I.e. not dependent upon
    any input from the end-user).

    YMMV.

    --- PyGate Linux v1.5.14
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From James Kuyper@3:633/10 to All on Mon Apr 27 17:28:09 2026
    Subject: Re: g++: What command line option allow me to get the most friendly/responsive compiling error message?

    On 2026-04-27 11:27, ??Jacek Marcin Jaworski?? wrote:
    Hello!

    What g++ command line option allow me to get the most
    friendly/responsive compiling error message? I use:

    -Wformat=2

    which is not very friendly.

    That is a highly subjective opinion. You'll get different answers from different people. In general, each person's answer is "right" for that
    person, but not necessarily for anyone else. I normally build using
    make, which looks for and uses an environment variable named CXXFLAGS
    when compiling C++ code, and I've got CXXFLAGS set to:

    -std=c++23 -pedantic -Wall -O2 -Wpointer-arith -Wcast-align -fno-enforce-eh-specs -fno-gnu-keywords -fno-nonansi-builtins -Wctor-dtor-privacy -Wnon-virtual-dtor -Wold-style-cast
    -Woverloaded-virtual -Wsign-promo

    I guarantee you that my posting that list of options will cause many
    people to disagree - whether they'll bother saying so, I don't know.


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