Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
scott@slp53.sl.home (Scott Lurndal) writes:
ram@zedat.fu-berlin.de (Stefan Ram) writes:
Richard Harnden <richard.nospam@gmail.invalid> wrote or quoted:
int hex = colour_to_hex(10);
... then the compiler doesn't complain that 10 is not in the enum.
Why? Surely the compiler can tell.
I get
|
|error: enum conversion when passing argument 1 of 'colour_to_hex' is
invalid in C++ [-Wc++-compat]
| |int hex = colour_to_hex(10);
| | ^~
|note: expected 'enum colour' but argument is of type 'int'
| | int colour_to_hex(enum colour colour)
| | ^~~~~~~~~~~~~
|
with
gcc -Wc++-compat
That example exemplifies the seriously screwed up error reporting in the >>> gnu compiler collection.
One line of informative error message followed by 5 lines of useless
cruft to wade through. And no way to turn it off completely.
That's true, but it can be reduced to only two lines total (so only one >>line more than needed), by using -fno-diagnostics-show-caret.
Yes, I use that. I still find that the "note:" lines clutter the
output and provide zero benefit.
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
scott@slp53.sl.home (Scott Lurndal) writes:
ram@zedat.fu-berlin.de (Stefan Ram) writes:
Richard Harnden <richard.nospam@gmail.invalid> wrote or quoted:
int hex = colour_to_hex(10);
... then the compiler doesn't complain that 10 is not in the enum.
Why? Surely the compiler can tell.
I get
|
|error: enum conversion when passing argument 1 of 'colour_to_hex' is
invalid in C++ [-Wc++-compat]
| |int hex = colour_to_hex(10);
| | ^~
|note: expected 'enum colour' but argument is of type 'int'
| | int colour_to_hex(enum colour colour)
| | ^~~~~~~~~~~~~
|
with
gcc -Wc++-compat
That example exemplifies the seriously screwed up error reporting in the >>> gnu compiler collection.
One line of informative error message followed by 5 lines of useless
cruft to wade through. And no way to turn it off completely.
That's true, but it can be reduced to only two lines total (so only one >>line more than needed), by using -fno-diagnostics-show-caret.
Yes, I use that. I still find that the "note:" lines clutter the
output and provide zero benefit.
scott@slp53.sl.home (Scott Lurndal) writes:
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
scott@slp53.sl.home (Scott Lurndal) writes:
ram@zedat.fu-berlin.de (Stefan Ram) writes:
Richard Harnden <richard.nospam@gmail.invalid> wrote or quoted:
int hex = colour_to_hex(10);
... then the compiler doesn't complain that 10 is not in the enum. >>>>>> Why? Surely the compiler can tell.
I get
|
|error: enum conversion when passing argument 1 of 'colour_to_hex' is >>>>> invalid in C++ [-Wc++-compat]
| |int hex = colour_to_hex(10);
| | ^~
|note: expected 'enum colour' but argument is of type 'int'
| | int colour_to_hex(enum colour colour)
| | ^~~~~~~~~~~~~
|
with
gcc -Wc++-compat
That example exemplifies the seriously screwed up error reporting in the >>>> gnu compiler collection.
One line of informative error message followed by 5 lines of useless
cruft to wade through. And no way to turn it off completely.
That's true, but it can be reduced to only two lines total (so only one >>>line more than needed), by using -fno-diagnostics-show-caret.
Yes, I use that. I still find that the "note:" lines clutter the
output and provide zero benefit.
Does
gcc -fcompare-debug-second -fno-diagnostics-show-caret
Ben Bacarisse <ben@bsb.me.uk> writes:....
scott@slp53.sl.home (Scott Lurndal) writes:
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
That's true, but it can be reduced to only two lines total (so only one >>>>line more than needed), by using -fno-diagnostics-show-caret.
Yes, I use that. I still find that the "note:" lines clutter the
output and provide zero benefit.
Does
gcc -fcompare-debug-second -fno-diagnostics-show-caret
We use the latter. It doesn't get rid of the 'note' sections, however.
For some reason, -fcompare-debug-second is commented out in our Makefile, but it appears that only applies in when a second compile is required.
scott@slp53.sl.home (Scott Lurndal) writes:
Ben Bacarisse <ben@bsb.me.uk> writes:
scott@slp53.sl.home (Scott Lurndal) writes:
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
...
That's true, but it can be reduced to only two lines total (so
only one line more than needed), by using
-fno-diagnostics-show-caret.
Yes, I use that. I still find that the "note:" lines clutter the
output and provide zero benefit.
Does
gcc -fcompare-debug-second -fno-diagnostics-show-caret
We use the latter. It doesn't get rid of the 'note' sections,
however.
For some reason, -fcompare-debug-second is commented out in our
Makefile, but it appears that only applies in when a second compile
is required.
It appears to have a second "side-effect" use. It removes notes
when I use it.
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 6 |
Nodes: | 8 (0 / 8) |
Uptime: | 129:42:27 |
Calls: | 154 |
Files: | 21,500 |
Messages: | 79,169 |