Skip to content

Commit

Permalink
Fix PRIu8 in log statement (#15095)
Browse files Browse the repository at this point in the history
It's causing a crash on P6 hardware, due to this GCC issue:

https://answers.launchpad.net/gcc-arm-embedded/+question/269083

%u is safe and appropriate so long as the arg is unsigned and not
larger than unsigned int, because the arg promotes to unsigned int.
  • Loading branch information
mlepage-google authored and pull[bot] committed Dec 21, 2023
1 parent 8b9fac6 commit 1541922
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/access/AccessControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ CHIP_ERROR AccessControl::Check(const SubjectDescriptor & subjectDescriptor, con
{
char buf[6 * kCharsPerCatForLogging];
ChipLogDetail(DataManagement,
"AccessControl: checking f=%" PRIu8 " a=%c s=0x" ChipLogFormatX64 " t=%s c=" ChipLogFormatMEI " e=%" PRIu16
" p=%c",
"AccessControl: checking f=%u a=%c s=0x" ChipLogFormatX64 " t=%s c=" ChipLogFormatMEI " e=%" PRIu16 " p=%c",
subjectDescriptor.fabricIndex, GetAuthModeStringForLogging(subjectDescriptor.authMode),
ChipLogValueX64(subjectDescriptor.subject), GetCatStringForLogging(buf, sizeof(buf), subjectDescriptor.cats),
ChipLogValueMEI(requestPath.cluster), requestPath.endpoint, GetPrivilegeStringForLogging(requestPrivilege));
Expand Down

0 comments on commit 1541922

Please sign in to comment.