This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Fix diagnostics for one-byte length modifier
ClosedPublic

Authored by AntonBikineev on Mar 4 2021, 7:43 AM.

Details

Summary

In case a char-literal of type int (C/ObjectiveC) corresponds to a
format specifier with the %hh length modifier, don't treat the literal
as of type char for issuing diagnostics, as otherwise this results in:

printf("%hhd", 'e');
warning: format specifies type 'char' but the argument has type 'char'.

Diff Detail

Repository
rC Clang

Event Timeline

AntonBikineev requested review of this revision.Mar 4 2021, 7:43 AM
AntonBikineev created this revision.
This revision is now accepted and ready to land.Mar 9 2021, 5:52 AM
This revision was automatically updated to reflect the committed changes.

Thanks Aaron for taking a look!