public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104534] New: write-strings does not follow C++ standard
@ 2022-02-14 20:02 johnsen.david at siemens dot com
2022-02-14 20:11 ` [Bug c++/104534] " pinskia at gcc dot gnu.org
2022-02-21 15:31 ` egallager at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: johnsen.david at siemens dot com @ 2022-02-14 20:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104534
Bug ID: 104534
Summary: write-strings does not follow C++ standard
Product: gcc
Version: 10.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: johnsen.david at siemens dot com
Target Milestone: ---
The bug is present in all versions of GCC from 6 to 11 and on GCC trunk.
example file ws.cpp:
#include <iostream>
void f(char*) { std::cout << "This compiler is broken" << std::endl; }
void f(bool) { std::cout << "This compiler is correct" << std::endl; }
int main() {
f("This is supposed to work");
return 0;
}
This program is a valid C++ and the standard is very clear on what the result
should be.
As far as I know, there is no way to make GCC generate this result.
compiled with: c++ ws.cpp
Depending on the command line options, the program can:
* compile (and run incorrectly, -Wnowrite-strings),
* compile with a warning (still run incorrectly, -Wwrite-strings),
* or not compile at all (-Werror -Wwrite-strings).
The only outcome that I can't get is the correct one:
* The program compiles without errors and runs correctly.
Other compilers, such as clang++ and Visual Studio C++, follow the standard.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/104534] write-strings does not follow C++ standard
2022-02-14 20:02 [Bug c++/104534] New: write-strings does not follow C++ standard johnsen.david at siemens dot com
@ 2022-02-14 20:11 ` pinskia at gcc dot gnu.org
2022-02-21 15:31 ` egallager at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-14 20:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104534
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 95596.
*** This bug has been marked as a duplicate of bug 95596 ***
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/104534] write-strings does not follow C++ standard
2022-02-14 20:02 [Bug c++/104534] New: write-strings does not follow C++ standard johnsen.david at siemens dot com
2022-02-14 20:11 ` [Bug c++/104534] " pinskia at gcc dot gnu.org
@ 2022-02-21 15:31 ` egallager at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: egallager at gcc dot gnu.org @ 2022-02-21 15:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104534
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=61579
CC| |egallager at gcc dot gnu.org
--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
see also bug 61579, too
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-21 15:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 20:02 [Bug c++/104534] New: write-strings does not follow C++ standard johnsen.david at siemens dot com
2022-02-14 20:11 ` [Bug c++/104534] " pinskia at gcc dot gnu.org
2022-02-21 15:31 ` egallager at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).