Repository navigation
Conversation
…evel [] In C, an implicit conversion such as "int **" to "const int *const *" is valid in C++ but violates the constraints of simple assignment, because the types pointed to are not compatible (C23 6.5.17.2), so a diagnostic is required (C23 5.1.1.3). The front end accepted it as an extension without one. Issue the caller's default warning when no more specific warning applies; the conversion is still accepted.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Collaborator
|
AcknowlEDG review results updated for
|
Collaborator
|
AcknowlEDG review results updated for
CI success. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In C, the front end accepted an implicit conversion that adds qualifiers below the first level, such as
int **toconst int *const *, without a diagnostic. C++ allows this conversion. In C the pointed-to types are not compatible, so it violates the constraints of simple assignment (C23 6.5.17.2), and a diagnostic is required. GCC 14 and later reject it by default.In
types.c, a C conversion that takes this path now gets the caller's default warning when no more specific warning applies. The conversion is still accepted.regressions/c-deep-pointer-qualificationchecks for the warning in GNU C23 mode and with--strict_warnings.regressions/c-deep-pointer-qualification-positivechecks that addingconstonly at the first level, or converting with an explicit cast, gets no diagnostic in strict mode, andregressions/cpp-deep-pointer-qualificationthat C++ is unchanged.Tested with the full test suites for edg_x86_64 and edg_x86_64_cp, compared with a run of main, and with the new and changed tests for edg_x86_32 and edg_x86_32_cp.
The
Changesentry refers to the discussion until there is an issue for it.Reported in discussion #472.