Repository navigation
GNU mode accepts char ** to const char ** with a warning instead of an error #297
71iq
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.
Version
Compiler: 7.0, commit
43e10b90fc83ed2a436fb79b241be8dbf3dc6846Platform: Linux x86_64 (LP64)
Reference/compiler for generated C: GCC 13.3.0
Preset:
linux-gcc-debug, withEDG_CPFE_USE_ASAN=OFFRelevant configuration:
Code to reproduce
Compiler options:
Behavior
GCC rejects this initialization without
-fpermissiveand exits with status 1:GNU emulation instead generates C and exits with status 0, issuing a warning:
The conversion is ill-formed under C++20 [conv.qual]/3. The permitted destination is
const char *const *, notconst char **.Strict ISO mode (
--c++20 --strict, without GNU emulation) correctly rejects it and exits with status 2.This report concerns GNU compatibility and diagnostic severity. A warning is already a diagnostic; it is not a report of a missing diagnostic. Is accepting the conversion as an extension intentional?
Reference: https://timsong-cpp.github.io/cppwp/n4861/conv.qual#3.
The attachment contains the full
--dump_configurationoutput and self-contained reproduction inputs.Source, generated C, results, and full configuration
Reporting acknowledgements
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