Skip to content

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

@heitbaum

Description

@heitbaum

Bug description:

The second (and only other C23 discards 'const' warning)

../Objects/stringlib/fastsearch.h: In function 'ucs2lib_find_char':
../Objects/stringlib/fastsearch.h:72:35: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   72 |                 void *candidate = memchr(p, needle,
      |                                   ^~~~~~

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

  • gh-145095

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions