Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-12-18 Thread Jakub Jelinek
On Wed, Dec 18, 2024 at 05:35:28PM -0500, David Malcolm wrote: > Is _Bool meant to be usable in c90? It is a keyword even when GCC compiles with -std={c89,c90,gnu89,gnu90} (why not, _Bool is a reserved identifier in C89). With -pedantic/-pedantic-errors there is a pedwarn about using it as a type,

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-12-18 Thread Sam James
Sam James writes: > David Malcolm writes: > >> On Tue, 2024-11-26 at 16:35 -0500, Marek Polacek wrote: >>> On Mon, Nov 25, 2024 at 10:49:02PM -0500, David Malcolm wrote: >>> > This patch attempts to provide better error messages for >>> > code compiled with C23 that hasn't been updated for >>> >

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-12-18 Thread Andrew Pinski
On Wed, Dec 18, 2024 at 2:37 PM David Malcolm wrote: > > On Tue, 2024-11-26 at 16:35 -0500, Marek Polacek wrote: > > On Mon, Nov 25, 2024 at 10:49:02PM -0500, David Malcolm wrote: > > > This patch attempts to provide better error messages for > > > code compiled with C23 that hasn't been updated f

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-12-18 Thread Sam James
David Malcolm writes: > On Tue, 2024-11-26 at 16:35 -0500, Marek Polacek wrote: >> On Mon, Nov 25, 2024 at 10:49:02PM -0500, David Malcolm wrote: >> > This patch attempts to provide better error messages for >> > code compiled with C23 that hasn't been updated for >> > "bool", "true", and "false"

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-12-18 Thread David Malcolm
On Tue, 2024-11-26 at 16:35 -0500, Marek Polacek wrote: > On Mon, Nov 25, 2024 at 10:49:02PM -0500, David Malcolm wrote: > > This patch attempts to provide better error messages for > > code compiled with C23 that hasn't been updated for > > "bool", "true", and "false" becoming keywords (based on >

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-12-13 Thread Sam James
Sam James writes: > David Malcolm writes: > >> This patch attempts to provide better error messages for >> code compiled with C23 that hasn't been updated for >> "bool", "true", and "false" becoming keywords (based on >> a brief review of the Gentoo bug tracker links given at >> https://gcc.gnu.

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-12-06 Thread Sam James
David Malcolm writes: > This patch attempts to provide better error messages for > code compiled with C23 that hasn't been updated for > "bool", "true", and "false" becoming keywords (based on > a brief review of the Gentoo bug tracker links given at > https://gcc.gnu.org/pipermail/gcc/2024-Novem

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-11-26 Thread Jakub Jelinek
On Tue, Nov 26, 2024 at 04:35:15PM -0500, Marek Polacek wrote: > Thanks for the patch. > > For: > > typedef int _Bool; > > or > > int _Bool; > > this patch says: > > note: '_Bool' is a keyword with '-std=c23' onwards > > but I don't think that's true: _Bool was added in C99 and is obso

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-11-26 Thread Florian Weimer
* David Malcolm: > whereas with this patch we emit: > > t1.c:7:13: error: 'bool' cannot be defined via 'typedef' > 7 | typedef int bool; > | ^~~~ > t1.c:7:13: note: 'bool' is a keyword with '-std=c23' onwards > t1.c:7:1: warning: useless type name in empty declaration > 7

Re: [PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-11-26 Thread Marek Polacek
On Mon, Nov 25, 2024 at 10:49:02PM -0500, David Malcolm wrote: > This patch attempts to provide better error messages for > code compiled with C23 that hasn't been updated for > "bool", "true", and "false" becoming keywords (based on > a brief review of the Gentoo bug tracker links given at > https

[PATCH] c: special-case some "bool" errors with C23 [PR117629]

2024-11-25 Thread David Malcolm
This patch attempts to provide better error messages for code compiled with C23 that hasn't been updated for "bool", "true", and "false" becoming keywords (based on a brief review of the Gentoo bug tracker links given at https://gcc.gnu.org/pipermail/gcc/2024-November/245185.html). Specifically: