[all-commits] [llvm/llvm-project] c628e8: [clang] Fix FP -Wformat in functions with 2+ attri...
apple-fcloutier via All-commits
all-commits at lists.llvm.org
Thu Mar 6 09:12:44 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c628e8e9ea86a225af846875740d0189f7cd3722
https://github.com/llvm/llvm-project/commit/c628e8e9ea86a225af846875740d0189f7cd3722
Author: apple-fcloutier <75502309+apple-fcloutier at users.noreply.github.com>
Date: 2025-03-06 (Thu, 06 Mar 2025)
Changed paths:
M clang/lib/Sema/SemaChecking.cpp
M clang/test/Sema/format-strings.c
Log Message:
-----------
[clang] Fix FP -Wformat in functions with 2+ attribute((format)) (#129954)
When defining functions with two or more format attributes, if the
format strings don't have the same format family, there is a false
positive warning that the incorrect kind of format string is being
passed at forwarded format string call sites.
This happens because we check that the format string family of each
format attribute is compatible before we check that we're using the
associated format parameter. The fix is to move the check down one
scope, after we've established that we are checking the right parameter.
Tests are updated to include a true negative and a true positive of this
situation.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list