Skip to content

Compiler warning when using C23: initialization discards 'const' qualifier from pointer target type #145092

@heitbaum

Description

@heitbaum

Bug report

Bug description:

../Python/preconfig.c: In function '_Py_get_xoption':
../Python/preconfig.c:587:24: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  587 |         wchar_t *sep = wcschr(option, L'=');
      |                        ^~~~~~
../Python/preconfig.c: In function 'preconfig_init_utf8_mode':
../Python/preconfig.c:618:24: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
{
  618 |         wchar_t *sep = wcschr(xopt, L'=');
      |                        ^~~~~~

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions