mirror of
https://gitee.com/openharmony/third_party_spirv-tools
synced 2024-11-23 15:30:36 +00:00
Fix use of Logf to avoid format security warning (#2498)
When -Wformat-security is enabled, we are getting an error. I do not claim to fully understand when the warning is triggered or not, but this one can be avoided by calling "Log" instead of "Logf" because the formating string is not needed.
This commit is contained in:
parent
0cb2d4079e
commit
7ce37d66a8
@ -526,10 +526,12 @@ bool Optimizer::Run(const uint32_t* original_binary,
|
||||
binary_changed = true;
|
||||
} else if (status == opt::Pass::Status::SuccessWithoutChange) {
|
||||
if (optimized_binary->size() != original_binary_size ||
|
||||
(memcmp(optimized_binary->data(), original_binary, original_binary_size) != 0)) {
|
||||
(memcmp(optimized_binary->data(), original_binary,
|
||||
original_binary_size) != 0)) {
|
||||
binary_changed = true;
|
||||
Logf(consumer(), SPV_MSG_WARNING, nullptr, {},
|
||||
"Binary unexpectedly changed despite optimizer saying there was no change");
|
||||
Log(consumer(), SPV_MSG_WARNING, nullptr, {},
|
||||
"Binary unexpectedly changed despite optimizer saying there was no "
|
||||
"change");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user