[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/117364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. https://github.com/llvm/llvm-project/pull/117364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Aaron Ballman via cfe-commits
@@ -1103,7 +1103,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth())); - Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBool

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/117364 >From 37923ec9c6a0bbabd2640f7e95549bf560974e59 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 22 Nov 2024 14:18:33 -0500 Subject: [PATCH 1/5] [C23] Fixed the value of BOOL_WIDTH --- clang/docs/Re

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Timm Baeder via cfe-commits
@@ -1103,7 +1103,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth())); - Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBool

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/117364 >From 37923ec9c6a0bbabd2640f7e95549bf560974e59 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 22 Nov 2024 14:18:33 -0500 Subject: [PATCH 1/4] [C23] Fixed the value of BOOL_WIDTH --- clang/docs/Re

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/117364 >From 37923ec9c6a0bbabd2640f7e95549bf560974e59 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 22 Nov 2024 14:18:33 -0500 Subject: [PATCH 1/3] [C23] Fixed the value of BOOL_WIDTH --- clang/docs/Re

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Aaron Ballman via cfe-commits
@@ -1103,7 +1103,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth())); - Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBool

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Aaron Ballman via cfe-commits
@@ -1103,7 +1103,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth())); - Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBool

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -verify -std=c23 -ffreestanding %s + +/* WG14 N2412: Clang 14 + * Two's complement sign representation + */ +// expected-no-diagnostics + +#include + +// GH117348 -- BOOL_WIDTH was accidentally expanding to the number of bits in +// the object

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/117364 >From 37923ec9c6a0bbabd2640f7e95549bf560974e59 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 22 Nov 2024 14:18:33 -0500 Subject: [PATCH 1/2] [C23] Fixed the value of BOOL_WIDTH --- clang/docs/Re

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-23 Thread Jens Gustedt via cfe-commits
@@ -1103,7 +1103,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth())); - Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBool

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-22 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/117364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-22 Thread Richard Smith via cfe-commits
@@ -1103,7 +1103,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth())); - Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBool

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-22 Thread Richard Smith via cfe-commits
@@ -1103,7 +1103,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth())); - Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBool

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-22 Thread James Y Knight via cfe-commits
https://github.com/jyknight approved this pull request. https://github.com/llvm/llvm-project/pull/117364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-22 Thread Jessica Clarke via cfe-commits
@@ -1103,7 +1103,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth())); - Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBool

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-22 Thread Jessica Clarke via cfe-commits
@@ -1103,7 +1103,15 @@ static void InitializePredefinedMacros(const TargetInfo &TI, assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far"); Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth())); - Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBool

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-22 Thread Jessica Clarke via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -verify -std=c23 -ffreestanding %s + +/* WG14 N2412: Clang 14 + * Two's complement sign representation + */ +// expected-no-diagnostics + +#include + +// GH117348 -- BOOL_WIDTH was accidentally expanding to the number of bits in +// the object

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/117364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Aaron Ballman (AaronBallman) Changes The standard mandates that this returns the width of the type, which is the number of bits in the value. For bool, that's required to be `1` explicitly. --- Full diff: https://github.com/llvm/llvm-proj

[clang] [C23] Fixed the value of BOOL_WIDTH (PR #117364)

2024-11-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/117364 The standard mandates that this returns the width of the type, which is the number of bits in the value. For bool, that's required to be `1` explicitly. >From 37923ec9c6a0bbabd2640f7e95549bf560974e59 Mon S