Repository navigation
Strict mode defines a string literal of an inline function twice when it is cast to const signed char*
#243
thinkoid
started this conversation in
Issue Triage - Compilation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Issue Summary
When compiling in strict mode, multiple definitions of a string literal occur in the generated C code in an inline function, one for each C-style cast of it to
const signed char*orconst unsigned char*that is passed as a function argument. Every definition gets the same name, so gcc rejects the second one. If I also use the same literal without a cast, one more definition occurs, however many such uses there are. A valid program does not compile. The default mode and--g++compile it.Reproducing Source Code
Command-line Options
eccp -A -c t.cpp
Type of Issue
[Back End] There is a problem with the generated C code.
Additional Details
The generated C:
The same with
-a,-x --strict,--c++11 -A,--c++17 -Aand--c++23 -A.-x,--c++11 -xand--g++compile it. Seen at 773d310.Reproducing (Standard) Configuration(s)
linux-gcc-debug, linux-gcc-release, linux-gcc-debuggable-release
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
LICENSE.txtfile in my.zipor.tar.gzupload. If I included aLICENSE.txtfile, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.All reactions