This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Fix diagnostics formatting
Needs ReviewPublic

Authored by xtkoba on May 14 2022, 4:42 PM.

Details

Reviewers
aaron.ballman
Summary

When a #warning directive is followed by tokens containing non-ASCII characters encoded in UTF-8, a broken string can be printed out as a diagnostic message on some systems. This is because the current code assumes char to be signed char, whereas on some systems char is in fact unsigned char.

Diff Detail

Event Timeline

xtkoba created this revision.May 14 2022, 4:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2022, 4:42 PM
xtkoba requested review of this revision.May 14 2022, 4:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2022, 4:42 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

The issue was first reported by @dev-bz at GitHub in https://github.com/termux/termux-packages/issues/9619.

Thank you for this! Is there a way to add test coverage for this change? Also, this should come with a release note as it's fixing a bug someone reported.