OK, there are 3 members of non-POD type, any maybe inlining is not
adequate. But shouldn't the compiler just take the best implementation?
Or are default generated functions necessarily forced to be inline?
On Tue 8/19/2025 1:33 PM, Marcel Mueller wrote:
OK, there are 3 members of non-POD type, any maybe inlining is not
adequate. But shouldn't the compiler just take the best implementation?
Or are default generated functions necessarily forced to be inline?
It might be a simple consequence of a lazy implementation.
Am 21.08.25 um 07:58 schrieb Andrey Tarasevich:
On Tue 8/19/2025 1:33 PM, Marcel Mueller wrote:
OK, there are 3 members of non-POD type, any maybe inlining is not
adequate. But shouldn't the compiler just take the best implementation?
Or are default generated functions necessarily forced to be inline?
It might be a simple consequence of a lazy implementation.
It turned out that this kind of warning of gcc is normally turned off
and not even activated by -Wextra. But some guy managed to explicitly
enable this warning in a dark corner of the custom automake macros of
the project. -.-
On Sat, 23 Aug 2025 10:41:12 +0200
Marcel Mueller <news.5.maazl@spamgourmet.org> gabbled:
Am 21.08.25 um 07:58 schrieb Andrey Tarasevich:
On Tue 8/19/2025 1:33 PM, Marcel Mueller wrote:
OK, there are 3 members of non-POD type, any maybe inlining is not
adequate. But shouldn't the compiler just take the best implementation? >>>> Or are default generated functions necessarily forced to be inline?
It might be a simple consequence of a lazy implementation.
It turned out that this kind of warning of gcc is normally turned off
and not even activated by -Wextra. But some guy managed to explicitly
enable this warning in a dark corner of the custom automake macros of
the project. -.-
As an aside, the inconsistency of gcc cmd line options wrt warnings and between
versions really pisses me off. It shouldn't even need -Wextra (or - pedantic) if
I've already given it -Wall because all funnily enough means all, it
doesn't mean all except some random ones - which seem to change between versions - it won't show unless you give extra options.
Until recently I was compiling all my straight C code on gcc v4 because it gave quite useful warnings that later versions wouldn't show no matter what options you gave them.
meant "all warnings" when it was first introduced, but these days there
are hundreds of warning flags in gcc, and /nobody/ wants them all
enabled.
suitable for a wide range of programs". Warnings that are triggered by >common code constructs - whether the code is right or wrong - are rarely >added to the set of "-Wall" warnings because they could mess up build >scripts for existing code (especially if the build has "-Werror" to turn >warnings into errors).
and other options come and go (I know I have). gcc has more warnings
than most compilers, but clang has even more. It also has a compiler
option "-Weverything" that really does enable all warnings. It is only
On Sat, 23 Aug 2025 16:15:03 +0200
David Brown <david.brown@hesbynett.no> gabbled:
meant "all warnings" when it was first introduced, but these days
there are hundreds of warning flags in gcc, and /nobody/ wants them
all enabled.
Presumably "nobody" is defined in a similar way as "all". It almost no one but some people will. I'm one of them.
suitable for a wide range of programs". Warnings that are triggered
by common code constructs - whether the code is right or wrong - are
rarely added to the set of "-Wall" warnings because they could mess up
build scripts for existing code (especially if the build has "-Werror"
to turn warnings into errors).
And why is that a bad idea? Perhaps some hidden bugs have been found. If
you don't want that behaviour then don't upgrade the compiler.
and other options come and go (I know I have). gcc has more warnings
than most compilers, but clang has even more. It also has a compiler
option "-Weverything" that really does enable all warnings. It is only
Didn't know about Weverything, just tried it and its actually found a
minor bug
in a program I'm working on atm.
On 23/08/2025 16:26, boltar@caprica.universe wrote:[...]
On Sat, 23 Aug 2025 16:15:03 +0200
David Brown <david.brown@hesbynett.no> gabbled:
meant "all warnings" when it was first introduced, but these days
there are hundreds of warning flags in gcc, and /nobody/ wants them
all enabled.
Presumably "nobody" is defined in a similar way as "all". It almost no
one
but some people will. I'm one of them.
I very much doubt that you are.
Do you want a warning when you write "float x, y; x = y + 2.5;" ? Do
On 8/24/2025 5:45 AM, David Brown wrote:
On 23/08/2025 16:26, boltar@caprica.universe wrote:[...]
On Sat, 23 Aug 2025 16:15:03 +0200
David Brown <david.brown@hesbynett.no> gabbled:
meant "all warnings" when it was first introduced, but these days
there are hundreds of warning flags in gcc, and /nobody/ wants them
all enabled.
Presumably "nobody" is defined in a similar way as "all". It almost
no one
but some people will. I'm one of them.
I very much doubt that you are.
Do you want a warning when you write "float x, y; x = y + 2.5;" ? Do
x = y + 2.5
Actually, sometimes I want a warning wrt 2.5 vs 2.5f...
On 23/08/2025 16:26, boltar@caprica.universe wrote:
On Sat, 23 Aug 2025 16:15:03 +0200
David Brown <david.brown@hesbynett.no> gabbled:
meant "all warnings" when it was first introduced, but these days
there are hundreds of warning flags in gcc, and /nobody/ wants them
all enabled.
Presumably "nobody" is defined in a similar way as "all". It almost no one >> but some people will. I'm one of them.
I very much doubt that you are.
Do you want a warning when you write "float x, y; x = y + 2.5;" ? Do
you want a warning when you write "char x; x = x + 1;" ? Do you want a
warning for "printf(s);" instead of "printf("%s", s);" ? Do you want a
warning for all "switch" statements which don't have a "default" case?
Do you want a warning on "int * p = 0;" ? Do you want to warn about >constructs that are not present in C or C++ standards other than the one
you have chosen?
Of course you are free to enable as many warnings as you like when you
use gcc. But before the gcc developers would bother implementing a >"-Wabsolutely-everything" flag, they'd have to be persuaded that it
would actually be useful to developers, worth the effort of implementing
it, and worth the cost of the consequences of it (such a flag would
limit the possibilities for flags that are not simply on/off). I have
seen discussions on the gcc mailing lists about a clang-style
"-Weverything" flag for gcc, and read about why it is considered
something of a joke flag in clang and only really of use when testing
the compiler.
handled in some way, and not just ignored. A "give me everything" flag
that floods the output with false positives is only marginally better
than no warnings at all.
Didn't know about Weverything, just tried it and its actually found a
minor bug
in a program I'm working on atm.
Then you might want to look at the available warning options in whatever >compiler(s) you use, and start enabling them in your build system.
On 8/24/2025 5:45 AM, David Brown wrote:
On 23/08/2025 16:26, boltar@caprica.universe wrote:[...]
On Sat, 23 Aug 2025 16:15:03 +0200
David Brown <david.brown@hesbynett.no> gabbled:
meant "all warnings" when it was first introduced, but these days
there are hundreds of warning flags in gcc, and /nobody/ wants them
all enabled.
Presumably "nobody" is defined in a similar way as "all". It almost
no one
but some people will. I'm one of them.
I very much doubt that you are.
Do you want a warning when you write "float x, y; x = y + 2.5;" ? Do
x = y + 2.5
Actually, sometimes I want a warning wrt 2.5 vs 2.5f...
On Sun, 24 Aug 2025 14:45:12 +0200
David Brown <david.brown@hesbynett.no> gabbled:
warning for "printf(s);" instead of "printf("%s", s);" ? Do you want a
Why would that produce a warning?
On Sun, 24 Aug 2025 14:45:12 +0200
warning for "printf(s);" instead of "printf("%s", s);" ? Do you want a
Why would that produce a warning?
On Sun, 24 Aug 2025 14:45:12 +0200
David Brown <david.brown@hesbynett.no> gabbled:
On 23/08/2025 16:26, boltar@caprica.universe wrote:
On Sat, 23 Aug 2025 16:15:03 +0200
David Brown <david.brown@hesbynett.no> gabbled:
meant "all warnings" when it was first introduced, but these days
there are hundreds of warning flags in gcc, and /nobody/ wants them
all enabled.
Presumably "nobody" is defined in a similar way as "all". It almost
no one
but some people will. I'm one of them.
I very much doubt that you are.
Do you want a warning when you write "float x, y; x = y + 2.5;" ? Do
you want a warning when you write "char x; x = x + 1;" ? Do you want a
Do I want a warning about using uninitialised variables? Umm, let me think...
.. yes please!
warning for "printf(s);" instead of "printf("%s", s);" ? Do you want a
Why would that produce a warning?
warning for all "switch" statements which don't have a "default" case?
Happens already.
Do you want a warning on "int * p = 0;" ? Do you want to warn about
constructs that are not present in C or C++ standards other than the
one you have chosen?
Yes, otherwise I wouldn't have specified a particular version.
Of course you are free to enable as many warnings as you like when you
use gcc. But before the gcc developers would bother implementing a
"-Wabsolutely-everything" flag, they'd have to be persuaded that it
would actually be useful to developers, worth the effort of
implementing it, and worth the cost of the consequences of it (such a
flag would limit the possibilities for flags that are not simply
on/off). I have seen discussions on the gcc mailing lists about a
clang-style "-Weverything" flag for gcc, and read about why it is
considered something of a joke flag in clang and only really of use
when testing the compiler.
"all" should mean all, not almost all, or the ones considered useful.
There was nothing stopping them using a different flag, eg -Wstandard
or something like that for the kind of warnings considered useful.
handled in some way, and not just ignored. A "give me everything"
flag that floods the output with false positives is only marginally
better than no warnings at all.
Gcc standard warnings have nothing on the gibberish the C++ compiler
spits out
when there's a template error. Why the compiler writers think 3 pages of unintelligable crap is a useful tool in order to find what usually turns
out
to be a simple typo i have no idea. Clang is far better , though still far from perfect.
Didn't know about Weverything, just tried it and its actually found a
minor bug
in a program I'm working on atm.
Then you might want to look at the available warning options in
whatever compiler(s) you use, and start enabling them in your build
system.
Life is too short to google all possible warning flags and figure out which ones I need.
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 11 |
Nodes: | 8 (0 / 8) |
Uptime: | 51:29:21 |
Calls: | 166 |
Files: | 21,502 |
Messages: | 77,741 |