aaron.ballman added subscribers: jcranmer-intel, zahiraam.
aaron.ballman added inline comments.
Comment at: clang/lib/AST/FormatString.cpp:484-487
+ if (const auto *PT = argTy->getAs()) {
+if (PT->getPointeeType()->isCharType())
+ return Match;
+ }
MitalAshok updated this revision to Diff 549176.
MitalAshok added a comment.
Address feedback; Reuse DefaultArgumentPromotion instead of duplicating its
functionality when building VaArgExpr
There is the added bonus for it working with dependent types somewhat
(`template __builtin_va_arg(ap, T[
MitalAshok updated this revision to Diff 549177.
MitalAshok added a comment.
clang-format
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156054/new/
https://reviews.llvm.org/D156054
Files:
clang/docs/ReleaseNotes.rst
clang/lib/AST/FormatString.
jcranmer-intel added inline comments.
Comment at: clang/lib/Sema/SemaExpr.cpp:17317-17319
+if (TInfo->getType()->isSpecificBuiltinType(BuiltinType::Float) ||
+TInfo->getType()->isSpecificBuiltinType(BuiltinType::Half))
PromoteType = Context.DoubleTy;
--
aaron.ballman added a comment.
Precommit CI still has a related failure, it seems.
Comment at: clang/lib/Sema/SemaExpr.cpp:17317-17319
+if (TInfo->getType()->isSpecificBuiltinType(BuiltinType::Float) ||
+TInfo->getType()->isSpecificBuiltinType(BuiltinType::Half))
MitalAshok created this revision.
Herald added a project: All.
MitalAshok added a comment.
MitalAshok added a reviewer: aaron.ballman.
MitalAshok published this revision for review.
Herald added subscribers: cfe-commits, wangpc.
Herald added a project: clang.
There is one observable difference by
MitalAshok updated this revision to Diff 544073.
MitalAshok added a comment.
Target clang 18 instead
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156054/new/
https://reviews.llvm.org/D156054
Files:
clang/docs/ReleaseNotes.rst
clang/lib/Sema/S
aaron.ballman added a comment.
Thank you for working on this! FWIW, precommit Ci found a relevant test failure
that should also be addressed.
Comment at: clang/lib/Sema/SemaExpr.cpp:1062-1073
+ // C2x 6.5.2.2p6:
+ // The integer promotions are performed on each trailing ar
MitalAshok updated this revision to Diff 547311.
MitalAshok added a comment.
No longer warn on printf("%p", nullptr)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156054/new/
https://reviews.llvm.org/D156054
Files:
clang/docs/ReleaseNotes.rst
MitalAshok updated this revision to Diff 547353.
MitalAshok added a comment.
C99 7.15.1.1p2 explicitly allows a char* to be retrieved as a void* with
va_arg, so the -Wformat-pedantic warning was incorrect.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.o
aaron.ballman added a comment.
Precommit CI found a related issue that should be addressed.
Comment at: clang/www/cxx_dr_status.html:4376
Can nullptr be passed to an ellipsis?
-Unknown
+Clang 17
MitalAshok wrote:
> It may be better to mark this
MitalAshok updated this revision to Diff 547874.
MitalAshok marked an inline comment as done.
MitalAshok added a comment.
Fix scanf("%p", (char**)ptr) for -Wformat-pedantic
Also added more tests for %p and -Wformat
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://revie
MitalAshok added inline comments.
Comment at: clang/test/Sema/format-pointer.c:39
+ printf("%p", np);
+ scanf("%p", &np); // expected-warning {{format specifies type 'void **' but
the argument has type 'nullptr_t *'}}
+ scanf("%p", &npp); // pedantic-warning {{format specif
MitalAshok updated this revision to Diff 552356.
MitalAshok added a comment.
Use C's definition of type compatibility even in C++ mode (to not warn about
enums promoted to their underlying types)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156054
MitalAshok updated this revision to Diff 552357.
MitalAshok added a comment.
clang-format
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156054/new/
https://reviews.llvm.org/D156054
Files:
clang/docs/ReleaseNotes.rst
clang/lib/AST/ASTContext.cp
MitalAshok marked an inline comment as done.
MitalAshok added inline comments.
Comment at: clang/test/SemaCXX/varargs.cpp:34
enum Unscoped1 { One = 0x7FFF };
- (void)__builtin_va_arg(ap, Unscoped1); // ok
+ (void)__builtin_va_arg(ap, Unscoped1); // expected-warning {{sec
MitalAshok marked an inline comment as not done.
MitalAshok added inline comments.
Comment at: clang/test/SemaCXX/varargs.cpp:34
enum Unscoped1 { One = 0x7FFF };
- (void)__builtin_va_arg(ap, Unscoped1); // ok
+ (void)__builtin_va_arg(ap, Unscoped1); // expected-warning {
aaron.ballman added inline comments.
Comment at: clang/test/SemaCXX/varargs.cpp:34
enum Unscoped1 { One = 0x7FFF };
- (void)__builtin_va_arg(ap, Unscoped1); // ok
+ (void)__builtin_va_arg(ap, Unscoped1); // expected-warning {{second argument
to 'va_arg' is of promotable
MitalAshok updated this revision to Diff 553055.
MitalAshok added a comment.
enums now considered compatible with unsigned/signed versions of their
underlying type for the purposes of -Wvarargs
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156054/n
MitalAshok updated this revision to Diff 553056.
MitalAshok added a comment.
clang-format
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156054/new/
https://reviews.llvm.org/D156054
Files:
clang/docs/ReleaseNotes.rst
clang/lib/AST/FormatString.
MitalAshok added inline comments.
Comment at: clang/test/SemaCXX/varargs.cpp:34
enum Unscoped1 { One = 0x7FFF };
- (void)__builtin_va_arg(ap, Unscoped1); // ok
+ (void)__builtin_va_arg(ap, Unscoped1); // expected-warning {{second argument
to 'va_arg' is of promotable ty
aaron.ballman added a comment.
I think this is looking close to good, just had some minor nits and an extra
test case to consider.
Comment at: clang/lib/Sema/SemaExpr.cpp:17255
+ // Check if these are compatible types according to the C rules even in C++
+ // because va_arg
22 matches
Mail list logo