Skip to content

Disable -Wc++-keyword because of false positives#24283

Merged
Leont merged 1 commit intobleadfrom
leont/wc++-compat
Mar 15, 2026
Merged

Disable -Wc++-keyword because of false positives#24283
Leont merged 1 commit intobleadfrom
leont/wc++-compat

Conversation

@Leont
Copy link
Copy Markdown
Contributor

@Leont Leont commented Mar 15, 2026

This warning, a child category of -Wc++-compat, was causing a lot of false positives of the following variety because of a clang 21 issue, as reported in #24164:

In file included from op.c:163:
In file included from ./perl.h:6228:
./proto.h:6124:26: warning: identifier 'wchar_t' conflicts with a C++ keyword [-Wc++-keyword]
 6124 | Perl_mbtowc_(pTHX_ const wchar_t *pwc, const char *s, const Size_t len);
      |                          ^
1 warning generated.
  • This set of changes does not require a perldelta entry.

This warning, a child category of -Wc++-compat, was causing a lot of
false positives of the following variety:

In file included from op.c:163:
In file included from ./perl.h:6228:
./proto.h:6124:26: warning: identifier 'wchar_t' conflicts with a C++ keyword [-Wc++-keyword]
 6124 | Perl_mbtowc_(pTHX_ const wchar_t *pwc, const char *s, const Size_t len);
      |                          ^
1 warning generated.
@Leont Leont force-pushed the leont/wc++-compat branch from 288d746 to b9b8d7a Compare March 15, 2026 14:11
@Leont Leont changed the title Disable -Wc++compat because of false positives Disable -Wc++keyword because of false positives Mar 15, 2026
@jkeenan
Copy link
Copy Markdown
Contributor

jkeenan commented Mar 15, 2026

This will, in fact, eliminate the -Wc++-keyword build-time warnings using clang21 reported in #24164.

$ report-build-warnings cf5ae39493.freebsd.threaded.clang21.maketp.output.txt.gz
File:  cf5ae39493.freebsd.threaded.clang21.maketp.output.txt.gz

  Wc++-keyword                              73
  Wimplicit-void-ptr-cast                    4

$ report-build-warnings b9b8d7aecf.freebsd.threaded.clang21.maketp.output.txt.gz
File:  b9b8d7aecf.freebsd.threaded.clang21.maketp.output.txt.gz

  Wimplicit-void-ptr-cast                    4

@jkeenan jkeenan added the build-time-warnings Replaces [META] Build-time warnings RT #133556 label Mar 15, 2026
@Leont Leont merged commit 8e9c0b3 into blead Mar 15, 2026
67 checks passed
@Leont Leont changed the title Disable -Wc++keyword because of false positives Disable -Wc++-keyword because of false positives Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-time-warnings Replaces [META] Build-time warnings RT #133556

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants