Skip to content

Build against glibc-2.43 fails due to -Werror=discarded-qualifiers #782

@heitbaum

Description

@heitbaum

Describe the bug

../../../lib/hgfs/hgfsEscape.c: In function 'HgfsAddEscapeCharacter':
../../../lib/hgfs/hgfsEscape.c:201:15: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  201 |       illegal = strchr(HGFS_ILLEGAL_CHARS, bufIn[escapeContext->processedOffset]);
      |               ^
../../../lib/hgfs/hgfsEscape.c: In function 'HgfsIsEscapeSequence':
../../../lib/hgfs/hgfsEscape.c:586:21: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  586 |          substitute = strchr(HGFS_SUBSTITUTE_CHARS, bufIn[offset - 2]);
      |                     ^
../../../lib/hgfs/hgfsEscape.c:591:18: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  591 |       substitute = strchr(HGFS_SUBSTITUTE_CHARS, bufIn[offset - 1]);
      |                  ^
../../../lib/hgfs/hgfsEscape.c: In function 'HgfsEscapeUndoComponent':
../../../lib/hgfs/hgfsEscape.c:890:29: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  890 |          char* substitute = strchr(HGFS_SUBSTITUTE_CHARS, bufIn[offset - 1]);
      |                             ^~~~~~

Reproduction steps

  1. Build against glibc-2.43

Expected behavior

Successful compile

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions