zygoloid wrote:
(I guess we could also warn if an object-like macro is expanded and the macro
name is preceded or followed by a `$` with no whitespace, since that would also
behave differently under `-fdollars-in-identifiers`, but I suspect that's not
worth worrying about in practice.)
https:
zygoloid wrote:
> This will indeed break building the Linux kernel for x86_64 at least in my
> brief test
[...]
> ```
> In file included from arch/x86/kernel/acpi/wakeup_64.S:11:
> arch/x86/include/asm/nospec-branch.h:80:7: warning: '$' in identifier; did
> you mean to enable '-fdollars-in-iden
https://github.com/AaronBallman updated
https://github.com/llvm/llvm-project/pull/135407
>From c7e0132617ab01c12b393876b39381171996b793 Mon Sep 17 00:00:00 2001
From: Aaron Ballman
Date: Fri, 11 Apr 2025 13:03:07 -0400
Subject: [PATCH 1/6] Disable -fdollars-in-identifiers by default
Clang used
jyknight wrote:
> It appears that gcc only disallows '$' in identifiers in C++26 mode. Not sure
> how relevant that is to clang.
> [bugzilla](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110343) Or am I
> misreading that thread?
As far as I can tell, GCC has _not_ disallowed '$' in identifier
efriedma-quic wrote:
> Effectively checking for `LangOpts.DollarIdents || LangOpts.AsmPreprocessor`?
> Or do you think `DollarIdents` should be true if `AsmPreprocessor` is true?
Neither. DollarIdents is already off by default in AsmPreprocessor mode. We
should just preserve the existing beh
nathanchance wrote:
> We should disable the warning if we're preprocessing asm, which should mostly
> solve the issue with warnings.
Yes although the warnings from `arch/x86/include/asm/nospec-branch.h` do show
up from `.c` files so that would only partially fix it.
```
In file included from
AaronBallman wrote:
> We should disable the warning if we're preprocessing asm, which should mostly
> solve the issue with warnings.
Effectively checking for `LangOpts.DollarIdents || LangOpts.AsmPreprocessor`?
Or do you think `DollarIdents` should be true if `AsmPreprocessor` is true?
https:
efriedma-quic wrote:
We should disable the warning if we're preprocessing asm, which should mostly
solve the issue with warnings.
For the Linux kernel, does anything break other than the warnings?
https://github.com/llvm/llvm-project/pull/135407
___
nathanchance wrote:
> CC @nathanchance @nickdesaulniers for more information
This will indeed break building the Linux kernel for x86_64 at least in my
brief test, mainly because it uses the preprocessor for assembly files but
there are some macros that are included in both C and assembly that
R-Goc wrote:
Doesn't the Linux kernel use it for syscall names?
https://github.com/llvm/llvm-project/pull/135407
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
AaronBallman wrote:
> Doesn't the Linux kernel use it for syscall names? Might be wrong on this.
CC @nathanchance @nickdesaulniers for more information, but even if the kernel
does, is it a significant imposition to pass `-fdollars-in-identifiers` to
enable the extension explicitly?
https://g
AaronBallman wrote:
> It appears that gcc only disallows '$' in identifiers in C++26 mode. Not sure
> how relevant that is to clang.
> [bugzilla](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110343) Or am I
> misreading that thread?
I get the same reading, but I am not certain we want to foll
R-Goc wrote:
It appears that gcc only disallows '&' in identifiers in C++26 mode. Not sure
how relevant that is to clang.
[bugzilla](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110343)
https://github.com/llvm/llvm-project/pull/135407
___
cfe-commits
AaronBallman wrote:
> If you don't want to do anything fancy, can you just add a warning in
> Lexer::LexTokenInternal if we see a '$' (where we set the token type to
> tok::unknown)? That should be easy to implement, and have zero impact on
> lexer performance.
Okay, that's pretty reasonable.
https://github.com/AaronBallman updated
https://github.com/llvm/llvm-project/pull/135407
>From c7e0132617ab01c12b393876b39381171996b793 Mon Sep 17 00:00:00 2001
From: Aaron Ballman
Date: Fri, 11 Apr 2025 13:03:07 -0400
Subject: [PATCH 1/5] Disable -fdollars-in-identifiers by default
Clang used
https://github.com/R-Goc edited https://github.com/llvm/llvm-project/pull/135407
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,5 +1,5 @@
// REQUIRES: x86-registered-target
-// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o -
| FileCheck %s
+// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fdollars-in-identifiers
-fasm-blocks -emit-llvm -o - | FileCheck %s
@@ -7,7 +7,7 @@
#define foo`bar /* expected-error {{whitespace required after macro name}} */
#define foo2!bar /* expected-warning {{whitespace recommended after macro
name}} */
-#define foo3$bar /* expected-error {{'$' in identifier}} */
+#define foo3$bar /* expected-er
@@ -7,7 +7,7 @@
#define foo`bar /* expected-error {{whitespace required after macro name}} */
#define foo2!bar /* expected-warning {{whitespace recommended after macro
name}} */
-#define foo3$bar /* expected-error {{'$' in identifier}} */
+#define foo3$bar /* expected-er
efriedma-quic wrote:
If you don't want to do anything fancy, can you just add a warning in
Lexer::LexTokenInternal if we see a '$' (where we set the token type to
tok::unknown)? That should be easy to implement, and have zero impact on lexer
performance.
https://github.com/llvm/llvm-project/
@@ -1,5 +1,5 @@
// REQUIRES: x86-registered-target
-// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o -
| FileCheck %s
+// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fdollars-in-identifiers
-fasm-blocks -emit-llvm -o - | FileCheck %s
@@ -4036,6 +4036,7 @@ LangOptions getFormattingLangOpts(const FormatStyle
&Style) {
LangOpts.MicrosoftExt = 1;// To get kw___try, kw___finally.
LangOpts.DeclSpecKeyword = 1; // To get __declspec.
LangOpts.C99 = 1; // To get kw_restrict for non-underscore-prefixed res
AaronBallman wrote:
> > If we're going to do this, I think we need better diagnostics. Just
> > straight disabling this is going to give very confusing diagnostics to
> > anyone actually using dollar-signs in identifiers.
> > Some ideas:
> > ```
> > * We can give a warning if we see a "$" adjac
https://github.com/AaronBallman updated
https://github.com/llvm/llvm-project/pull/135407
>From c7e0132617ab01c12b393876b39381171996b793 Mon Sep 17 00:00:00 2001
From: Aaron Ballman
Date: Fri, 11 Apr 2025 13:03:07 -0400
Subject: [PATCH 1/4] Disable -fdollars-in-identifiers by default
Clang used
@@ -4036,6 +4036,7 @@ LangOptions getFormattingLangOpts(const FormatStyle
&Style) {
LangOpts.MicrosoftExt = 1;// To get kw___try, kw___finally.
LangOpts.DeclSpecKeyword = 1; // To get __declspec.
LangOpts.C99 = 1; // To get kw_restrict for non-underscore-prefixed res
AaronBallman wrote:
> If we're going to do this, I think we need better diagnostics. Just straight
> disabling this is going to give very confusing diagnostics to anyone actually
> using dollar-signs in identifiers.
>
> Some ideas:
>
> * We can give a warning if we see a "$" adjacent to a
https://github.com/AaronBallman updated
https://github.com/llvm/llvm-project/pull/135407
>From c7e0132617ab01c12b393876b39381171996b793 Mon Sep 17 00:00:00 2001
From: Aaron Ballman
Date: Fri, 11 Apr 2025 13:03:07 -0400
Subject: [PATCH 1/3] Disable -fdollars-in-identifiers by default
Clang used
https://github.com/cor3ntin approved this pull request.
THANKS!
https://github.com/llvm/llvm-project/pull/135407
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/135407
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,5 +1,5 @@
// REQUIRES: x86-registered-target
-// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o -
| FileCheck %s
+// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fdollars-in-identifiers
-fasm-blocks -emit-llvm -o - | FileCheck %s
@@ -119,7 +119,7 @@ LANGOPT(WChar , 1, 0, "wchar_t keyword")
LANGOPT(Char8 , 1, 0, "char8_t keyword")
LANGOPT(IEEE128 , 1, 0, "__ieee128 keyword")
LANGOPT(DeclSpecKeyword , 1, 0, "__declspec keyword")
-BENIGN_LANGOPT(DollarIdents , 1, 1, "'
https://github.com/zygoloid approved this pull request.
LGTM, thanks!
https://github.com/llvm/llvm-project/pull/135407
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic commented:
If we're going to do this, I think we need better diagnostics. Just straight
disabling this is going to give very confusing diagnostics to anyone actually
using dollar-signs in identifiers.
Some ideas:
- We can give a warning if we see a "$" adjac
https://github.com/AaronBallman updated
https://github.com/llvm/llvm-project/pull/135407
>From c7e0132617ab01c12b393876b39381171996b793 Mon Sep 17 00:00:00 2001
From: Aaron Ballman
Date: Fri, 11 Apr 2025 13:03:07 -0400
Subject: [PATCH 1/2] Disable -fdollars-in-identifiers by default
Clang used
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Aaron Ballman (AaronBallman)
Changes
Clang used to enable -fdollars-in-identifiers by default for compatibility with
GCC. However, this is no longer a conforming extension after WG21 P2558R2 and
WG14 N2701.
So this disables the dialect b
https://github.com/AaronBallman created
https://github.com/llvm/llvm-project/pull/135407
Clang used to enable -fdollars-in-identifiers by default for compatibility with
GCC. However, this is no longer a conforming extension after WG21 P2558R2 and
WG14 N2701.
So this disables the dialect by de
36 matches
Mail list logo