cor3ntin wrote:
Thanks for your first contribution. Maybe the first of many :D
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/cor3ntin closed
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
wheatman wrote:
@cor3ntin done, thanks for taking a look
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/wheatman updated
https://github.com/llvm/llvm-project/pull/69061
>From df15b6239557edaae8b3d7f63915bad494ad674f Mon Sep 17 00:00:00 2001
From: Brian Wheatman
Date: Sat, 14 Oct 2023 12:02:19 -0400
Subject: [PATCH] Remove warnings from -Wchar-subscripts for known positive
cons
cor3ntin wrote:
@wheatman can you rebase again? I want to make sure CI passes before merging
(and the bots were broken earlier today). Thanks.
LGTM otherwise
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@list
https://github.com/wheatman updated
https://github.com/llvm/llvm-project/pull/69061
>From 894e8623689abe615600d768ef4fbedea78ab799 Mon Sep 17 00:00:00 2001
From: Brian Wheatman
Date: Sat, 14 Oct 2023 12:02:19 -0400
Subject: [PATCH] Remove warnings from -Wchar-subscripts for known positive
cons
wheatman wrote:
@AaronBallman if there are no more comments, could you please merge it in
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit
https://github.com/wheatman updated
https://github.com/llvm/llvm-project/pull/69061
>From d19da42a2ccf65a6d9b6696ab0bdb3bb42cd3832 Mon Sep 17 00:00:00 2001
From: Brian Wheatman
Date: Sat, 14 Oct 2023 12:02:19 -0400
Subject: [PATCH] Remove warnings from -Wchar-subscripts for known positive
cons
wheatman wrote:
Thank you for the review.
I don't have write access, so unless @shafik has more comments, could one of
you merge it in
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://list
https://github.com/AaronBallman approved this pull request.
LGTM, thank you for the fix!
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/wheatman updated
https://github.com/llvm/llvm-project/pull/69061
>From 20e471721bbb17701954c3c6bf7f4342dd9bc3e2 Mon Sep 17 00:00:00 2001
From: Brian Wheatman
Date: Sat, 14 Oct 2023 12:02:19 -0400
Subject: [PATCH] Remove warnings from -Wchar-subscripts for known positive
cons
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff e6c0e8565cb05d5884de294b546dac85bc11b497
b46d376e803bae29231e313a623f508e22e6c9d6 --
wheatman wrote:
Thanks you for the comments. I made the updates and added the note in
`clang/docs/ReleaseNotes.rst`
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/
@@ -62,3 +62,28 @@ void t10(void) {
UnsignedCharTy subscript = 0;
int val = array[subscript]; // no warning for unsigned char
}
+
+void t11(void) {
+ int array[256] = { 0 };
+ int val = array['a']; // no warning for char with known positive value
+}
+
+void t12(void) {
+
https://github.com/wheatman updated
https://github.com/llvm/llvm-project/pull/69061
>From b46d376e803bae29231e313a623f508e22e6c9d6 Mon Sep 17 00:00:00 2001
From: Brian Wheatman
Date: Sat, 14 Oct 2023 12:02:19 -0400
Subject: [PATCH] Remove warnings from -Wchar-subscripts for known positive
cons
https://github.com/AaronBallman commented:
Thank you for this! The changes should come with a release note in
`clang/docs/ReleaseNotes.rst` so users know about the change in behavior.
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mai
@@ -6018,9 +6018,15 @@ Sema::CreateBuiltinArraySubscriptExpr(Expr *Base,
SourceLocation LLoc,
<< IndexExpr->getSourceRange());
if ((IndexExpr->getType()->isSpecificBuiltinType(BuiltinType::Char_S) ||
- IndexExpr->getType()->isSpecificBuiltinType(B
@@ -62,3 +62,28 @@ void t10(void) {
UnsignedCharTy subscript = 0;
int val = array[subscript]; // no warning for unsigned char
}
+
+void t11(void) {
+ int array[256] = { 0 };
+ int val = array['a']; // no warning for char with known positive value
+}
+
+void t12(void) {
+
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -Wchar-subscripts -fsyntax-only -verify %s
+
+void t1(void) {
+ int array[1] = { 0 };
+ char subscript = 0;
+ int val = array[subscript]; // expected-warning{{array subscript is of type
'char'}}
+}
+
+void t2(void) {
+ int array[1] = { 0
https://github.com/AaronBallman edited
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -Wchar-subscripts -fsyntax-only -verify %s
+
+void t1(void) {
+ int array[1] = { 0 };
+ char subscript = 0;
+ int val = array[subscript]; // expected-warning{{array subscript is of type
'char'}}
+}
+
+void t2(void) {
+ int array[1] = { 0
https://github.com/wheatman updated
https://github.com/llvm/llvm-project/pull/69061
>From af3b7f9a94d7862acf5bd56dfb0ef652a684244d Mon Sep 17 00:00:00 2001
From: Brian Wheatman
Date: Sat, 14 Oct 2023 12:02:19 -0400
Subject: [PATCH] Remove warnings from -Wchar-subscripts for known positive
cons
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -Wchar-subscripts -fsyntax-only -verify %s
+
+void t1(void) {
+ int array[1] = { 0 };
+ char subscript = 0;
+ int val = array[subscript]; // expected-warning{{array subscript is of type
'char'}}
+}
+
+void t2(void) {
+ int array[1] = { 0
https://github.com/shafik commented:
You need to make sure you tests have newlines at the end
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/wheatman edited
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/wheatman updated
https://github.com/llvm/llvm-project/pull/69061
>From 44e66636bd886b263a15fe9e49d575d8ea53592d Mon Sep 17 00:00:00 2001
From: Brian Wheatman
Date: Sat, 14 Oct 2023 12:02:19 -0400
Subject: [PATCH] Remove warnings from -Wchar-subscripts for known positive
cons
wheatman wrote:
I found the test I would want to modify here
(llvm-project/clang/test/Sema/warn-char-subscripts.c)
I will work on updating it
https://github.com/llvm/llvm-project/pull/69061
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: None (wheatman)
Changes
This is to address https://github.com/llvm/llvm-project/issues/18763
it removes warnings from using a signed char as an array bound if the char is a
known positives constant.
This goes one step farther than gcc do
https://github.com/wheatman created
https://github.com/llvm/llvm-project/pull/69061
This is to address https://github.com/llvm/llvm-project/issues/18763
it removes warnings from using a signed char as an array bound if the char is a
known positives constant.
This goes one step farther than gc
30 matches
Mail list logo