Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] boot/at91bootstrap3: fix build with host GCC 15
@ 2025-07-02 10:15 Edgar Bonet via buildroot
  2025-07-06 16:02 ` Romain Naour via buildroot
  2025-07-11 10:44 ` Thomas Perale via buildroot
  0 siblings, 2 replies; 6+ messages in thread
From: Edgar Bonet via buildroot @ 2025-07-02 10:15 UTC (permalink / raw)
  To: Buildroot development; +Cc: Simon Dawson

Building at91bootstrap3 with GCC15 fails with:

    include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
       23 | typedef unsigned char bool;
          |                       ^~~~
    include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards

This is due to GCC 15 defaulting to the C23 language dialect.

Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
---

Tested on an Acmesystems Acqua board.

Also build-tested with a 2×2×2 test matrix:
 - GCC version:        14, 15
 - patch included:     no, yes
 - bootloader version: v3.10.3, v4.0.0
as expected, all tests passed save for those with GCC 15 without the patch.

 ...conditionally-define-bool-false-and-.patch | 47 +++++++++++++++++++
 ...conditionally-define-bool-false-and-.patch | 46 ++++++++++++++++++
 2 files changed, 93 insertions(+)
 create mode 100644 boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
 create mode 100644 boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch

diff --git a/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch b/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
new file mode 100644
index 0000000000..d4e37a86f6
--- /dev/null
+++ b/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
@@ -0,0 +1,47 @@
+From 908c65678867565a934ea5a967bfe7e204d1ccaf Mon Sep 17 00:00:00 2001
+From: Edgar Bonet <bonet@grenoble.cnrs.fr>
+Date: Wed, 25 Jun 2025 11:13:43 +0200
+Subject: [PATCH] include/types.h: conditionally define bool, false and true
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+include/types.h typedefs ‘bool’ and macro-defines ‘false’ and ‘true’.
+However, since C23, these are predefine keywords. As C23 is the default
+C dialect for GCC 15, building with this compiler fails with:
+
+    include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
+       23 | typedef unsigned char bool;
+          |                       ^~~~
+    include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
+
+Fix this build failure by only defining ‘bool’, ‘false’ and ‘true’ on C
+dialects older than C23.
+
+Upstream: https://github.com/linux4sam/at91bootstrap/pull/188
+
+Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
+(cherry picked from commit 4aab60e634d588dffbd3154fd0cfce78272b750a)
+---
+ include/types.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/types.h b/include/types.h
+index 1246a4df..2c1a41cf 100644
+--- a/include/types.h
++++ b/include/types.h
+@@ -42,8 +42,11 @@ typedef signed long long s64;
+ typedef unsigned long size_t;
+ typedef signed long ssize_t;
+ 
++/* bool, false and true are predefined since C23. */
++#if __STDC_VERSION__ < 202311L
+ typedef unsigned char bool;
+ #define false	0U
+ #define true	1U
++#endif
+ 
+ #endif /* TYPES_H_ */
+-- 
+2.43.0
+
diff --git a/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch b/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch
new file mode 100644
index 0000000000..772a808690
--- /dev/null
+++ b/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch
@@ -0,0 +1,46 @@
+From 4aab60e634d588dffbd3154fd0cfce78272b750a Mon Sep 17 00:00:00 2001
+From: Edgar Bonet <bonet@grenoble.cnrs.fr>
+Date: Wed, 25 Jun 2025 11:13:43 +0200
+Subject: [PATCH] include/types.h: conditionally define bool, false and true
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+include/types.h typedefs ‘bool’ and macro-defines ‘false’ and ‘true’.
+However, since C23, these are predefine keywords. As C23 is the default
+C dialect for GCC 15, building with this compiler fails with:
+
+    include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
+       23 | typedef unsigned char bool;
+          |                       ^~~~
+    include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
+
+Fix this build failure by only defining ‘bool’, ‘false’ and ‘true’ on C
+dialects older than C23.
+
+Upstream: https://github.com/linux4sam/at91bootstrap/pull/188
+
+Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
+---
+ include/types.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/types.h b/include/types.h
+index 950b1a46..0ad9ae61 100644
+--- a/include/types.h
++++ b/include/types.h
+@@ -20,8 +20,11 @@ typedef signed long long s64;
+ typedef unsigned long size_t;
+ typedef signed long ssize_t;
+ 
++/* bool, false and true are predefined since C23. */
++#if __STDC_VERSION__ < 202311L
+ typedef unsigned char bool;
+ #define false	0U
+ #define true	1U
++#endif
+ 
+ #endif /* TYPES_H_ */
+-- 
+2.43.0
+
-- 
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/1] boot/at91bootstrap3: fix build with host GCC 15
  2025-07-02 10:15 [Buildroot] [PATCH 1/1] boot/at91bootstrap3: fix build with host GCC 15 Edgar Bonet via buildroot
@ 2025-07-06 16:02 ` Romain Naour via buildroot
  2025-07-06 16:43   ` Edgar Bonet via buildroot
  2025-07-11 10:44 ` Thomas Perale via buildroot
  1 sibling, 1 reply; 6+ messages in thread
From: Romain Naour via buildroot @ 2025-07-06 16:02 UTC (permalink / raw)
  To: Edgar Bonet, Buildroot development; +Cc: Simon Dawson

Hello Edgar,

Le 02/07/2025 à 12:15, Edgar Bonet via buildroot a écrit :
> Building at91bootstrap3 with GCC15 fails with:
> 
>     include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
>        23 | typedef unsigned char bool;
>           |                       ^~~~
>     include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
> 
> This is due to GCC 15 defaulting to the C23 language dialect.
> 
> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
> ---
> 
> Tested on an Acmesystems Acqua board.
> 
> Also build-tested with a 2×2×2 test matrix:
>  - GCC version:        14, 15
>  - patch included:     no, yes
>  - bootloader version: v3.10.3, v4.0.0
> as expected, all tests passed save for those with GCC 15 without the patch.
> 
>  ...conditionally-define-bool-false-and-.patch | 47 +++++++++++++++++++
>  ...conditionally-define-bool-false-and-.patch | 46 ++++++++++++++++++
>  2 files changed, 93 insertions(+)
>  create mode 100644 boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
>  create mode 100644 boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch
> 
> diff --git a/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch b/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
> new file mode 100644
> index 0000000000..d4e37a86f6
> --- /dev/null
> +++ b/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
> @@ -0,0 +1,47 @@
> +From 908c65678867565a934ea5a967bfe7e204d1ccaf Mon Sep 17 00:00:00 2001
> +From: Edgar Bonet <bonet@grenoble.cnrs.fr>
> +Date: Wed, 25 Jun 2025 11:13:43 +0200
> +Subject: [PATCH] include/types.h: conditionally define bool, false and true
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +include/types.h typedefs ‘bool’ and macro-defines ‘false’ and ‘true’.
> +However, since C23, these are predefine keywords. As C23 is the default
> +C dialect for GCC 15, building with this compiler fails with:
> +
> +    include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
> +       23 | typedef unsigned char bool;
> +          |                       ^~~~
> +    include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
> +
> +Fix this build failure by only defining ‘bool’, ‘false’ and ‘true’ on C
> +dialects older than C23.
> +
> +Upstream: https://github.com/linux4sam/at91bootstrap/pull/188
> +
> +Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
> +(cherry picked from commit 4aab60e634d588dffbd3154fd0cfce78272b750a)

This commit is not part of the at91bootstrap3 git tree. Did you backported your
patch from the PR (v4.0.0) to v3.10.3?
Maybe just add a comment [Edgar: backport to v3.10.3] since this has is not
stable yet until it merged.

Best regards,
Romain


> +---
> + include/types.h | 3 +++
> + 1 file changed, 3 insertions(+)
> +
> +diff --git a/include/types.h b/include/types.h
> +index 1246a4df..2c1a41cf 100644
> +--- a/include/types.h
> ++++ b/include/types.h
> +@@ -42,8 +42,11 @@ typedef signed long long s64;
> + typedef unsigned long size_t;
> + typedef signed long ssize_t;
> + 
> ++/* bool, false and true are predefined since C23. */
> ++#if __STDC_VERSION__ < 202311L
> + typedef unsigned char bool;
> + #define false	0U
> + #define true	1U
> ++#endif
> + 
> + #endif /* TYPES_H_ */
> +-- 
> +2.43.0
> +
> diff --git a/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch b/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch
> new file mode 100644
> index 0000000000..772a808690
> --- /dev/null
> +++ b/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch
> @@ -0,0 +1,46 @@
> +From 4aab60e634d588dffbd3154fd0cfce78272b750a Mon Sep 17 00:00:00 2001
> +From: Edgar Bonet <bonet@grenoble.cnrs.fr>
> +Date: Wed, 25 Jun 2025 11:13:43 +0200
> +Subject: [PATCH] include/types.h: conditionally define bool, false and true
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +include/types.h typedefs ‘bool’ and macro-defines ‘false’ and ‘true’.
> +However, since C23, these are predefine keywords. As C23 is the default
> +C dialect for GCC 15, building with this compiler fails with:
> +
> +    include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
> +       23 | typedef unsigned char bool;
> +          |                       ^~~~
> +    include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
> +
> +Fix this build failure by only defining ‘bool’, ‘false’ and ‘true’ on C
> +dialects older than C23.
> +
> +Upstream: https://github.com/linux4sam/at91bootstrap/pull/188
> +
> +Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
> +---
> + include/types.h | 3 +++
> + 1 file changed, 3 insertions(+)
> +
> +diff --git a/include/types.h b/include/types.h
> +index 950b1a46..0ad9ae61 100644
> +--- a/include/types.h
> ++++ b/include/types.h
> +@@ -20,8 +20,11 @@ typedef signed long long s64;
> + typedef unsigned long size_t;
> + typedef signed long ssize_t;
> + 
> ++/* bool, false and true are predefined since C23. */
> ++#if __STDC_VERSION__ < 202311L
> + typedef unsigned char bool;
> + #define false	0U
> + #define true	1U
> ++#endif
> + 
> + #endif /* TYPES_H_ */
> +-- 
> +2.43.0
> +

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/1] boot/at91bootstrap3: fix build with host GCC 15
  2025-07-06 16:02 ` Romain Naour via buildroot
@ 2025-07-06 16:43   ` Edgar Bonet via buildroot
  0 siblings, 0 replies; 6+ messages in thread
From: Edgar Bonet via buildroot @ 2025-07-06 16:43 UTC (permalink / raw)
  To: Romain Naour, Buildroot development; +Cc: Simon Dawson

Hello Romain! Hello all!

Today, Romain Naour wrote:
> Hello Edgar,
> 
> Le 02/07/2025 à 12:15, Edgar Bonet via buildroot a écrit :
>> Building at91bootstrap3 with GCC15 fails with:
>>
>>     include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
>>        23 | typedef unsigned char bool;
>>           |                       ^~~~
>>     include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
>>
>> This is due to GCC 15 defaulting to the C23 language dialect.
>>
>> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
>> ---
>>
>> Tested on an Acmesystems Acqua board.
>>
>> Also build-tested with a 2×2×2 test matrix:
>>  - GCC version:        14, 15
>>  - patch included:     no, yes
>>  - bootloader version: v3.10.3, v4.0.0
>> as expected, all tests passed save for those with GCC 15 without the patch.
>>
>>  ...conditionally-define-bool-false-and-.patch | 47 +++++++++++++++++++
>>  ...conditionally-define-bool-false-and-.patch | 46 ++++++++++++++++++
>>  2 files changed, 93 insertions(+)
>>  create mode 100644 boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
>>  create mode 100644 boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch
>>
>> diff --git a/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch b/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
>> new file mode 100644
>> index 0000000000..d4e37a86f6
>> --- /dev/null
>> +++ b/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
>> @@ -0,0 +1,47 @@
>> +From 908c65678867565a934ea5a967bfe7e204d1ccaf Mon Sep 17 00:00:00 2001
>> +From: Edgar Bonet <bonet@grenoble.cnrs.fr>
>> +Date: Wed, 25 Jun 2025 11:13:43 +0200
>> +Subject: [PATCH] include/types.h: conditionally define bool, false and true
>> +MIME-Version: 1.0
>> +Content-Type: text/plain; charset=UTF-8
>> +Content-Transfer-Encoding: 8bit
>> +
>> +include/types.h typedefs ‘bool’ and macro-defines ‘false’ and ‘true’.
>> +However, since C23, these are predefine keywords. As C23 is the default
>> +C dialect for GCC 15, building with this compiler fails with:
>> +
>> +    include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
>> +       23 | typedef unsigned char bool;
>> +          |                       ^~~~
>> +    include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
>> +
>> +Fix this build failure by only defining ‘bool’, ‘false’ and ‘true’ on C
>> +dialects older than C23.
>> +
>> +Upstream: https://github.com/linux4sam/at91bootstrap/pull/188
>> +
>> +Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
>> +(cherry picked from commit 4aab60e634d588dffbd3154fd0cfce78272b750a)
> 
> This commit is not part of the at91bootstrap3 git tree. Did you backported your
> patch from the PR (v4.0.0) to v3.10.3?

Indeed. I submitted a pull request against their master branch (which is
also the at91bootstrap-4.x branch). My plan is to wait until I have some
feedback before submitting a second pull request with the backport to
at91bootstrap-3.x.

However, since I got no response, and I am using v3.10.3 with buildroot,
I decided to send here this patch that addresses both of the versions
supported by buildroot.

> Maybe just add a comment [Edgar: backport to v3.10.3] since this has is not
> stable yet until it merged.

OK, I'll respin right now.

Thank-you for looking at this, and best regards,

Edgar.

> Best regards,
> Romain
> 
> 
>> +---
>> + include/types.h | 3 +++
>> + 1 file changed, 3 insertions(+)
>> +
>> +diff --git a/include/types.h b/include/types.h
>> +index 1246a4df..2c1a41cf 100644
>> +--- a/include/types.h
>> ++++ b/include/types.h
>> +@@ -42,8 +42,11 @@ typedef signed long long s64;
>> + typedef unsigned long size_t;
>> + typedef signed long ssize_t;
>> + 
>> ++/* bool, false and true are predefined since C23. */
>> ++#if __STDC_VERSION__ < 202311L
>> + typedef unsigned char bool;
>> + #define false	0U
>> + #define true	1U
>> ++#endif
>> + 
>> + #endif /* TYPES_H_ */
>> +-- 
>> +2.43.0
>> +
>> diff --git a/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch b/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch
>> new file mode 100644
>> index 0000000000..772a808690
>> --- /dev/null
>> +++ b/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch
>> @@ -0,0 +1,46 @@
>> +From 4aab60e634d588dffbd3154fd0cfce78272b750a Mon Sep 17 00:00:00 2001
>> +From: Edgar Bonet <bonet@grenoble.cnrs.fr>
>> +Date: Wed, 25 Jun 2025 11:13:43 +0200
>> +Subject: [PATCH] include/types.h: conditionally define bool, false and true
>> +MIME-Version: 1.0
>> +Content-Type: text/plain; charset=UTF-8
>> +Content-Transfer-Encoding: 8bit
>> +
>> +include/types.h typedefs ‘bool’ and macro-defines ‘false’ and ‘true’.
>> +However, since C23, these are predefine keywords. As C23 is the default
>> +C dialect for GCC 15, building with this compiler fails with:
>> +
>> +    include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
>> +       23 | typedef unsigned char bool;
>> +          |                       ^~~~
>> +    include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
>> +
>> +Fix this build failure by only defining ‘bool’, ‘false’ and ‘true’ on C
>> +dialects older than C23.
>> +
>> +Upstream: https://github.com/linux4sam/at91bootstrap/pull/188
>> +
>> +Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
>> +---
>> + include/types.h | 3 +++
>> + 1 file changed, 3 insertions(+)
>> +
>> +diff --git a/include/types.h b/include/types.h
>> +index 950b1a46..0ad9ae61 100644
>> +--- a/include/types.h
>> ++++ b/include/types.h
>> +@@ -20,8 +20,11 @@ typedef signed long long s64;
>> + typedef unsigned long size_t;
>> + typedef signed long ssize_t;
>> + 
>> ++/* bool, false and true are predefined since C23. */
>> ++#if __STDC_VERSION__ < 202311L
>> + typedef unsigned char bool;
>> + #define false	0U
>> + #define true	1U
>> ++#endif
>> + 
>> + #endif /* TYPES_H_ */
>> +-- 
>> +2.43.0
>> +
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/1] boot/at91bootstrap3: fix build with host GCC 15
  2025-07-02 10:15 [Buildroot] [PATCH 1/1] boot/at91bootstrap3: fix build with host GCC 15 Edgar Bonet via buildroot
  2025-07-06 16:02 ` Romain Naour via buildroot
@ 2025-07-11 10:44 ` Thomas Perale via buildroot
  2025-07-11 11:07   ` Baruch Siach via buildroot
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Perale via buildroot @ 2025-07-11 10:44 UTC (permalink / raw)
  To: Edgar Bonet; +Cc: Thomas Perale, Buildroot development

In reply of:
> Building at91bootstrap3 with GCC15 fails with:
> 
>     include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
>        23 | typedef unsigned char bool;
>           |                       ^~~~
>     include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
> 
> This is due to GCC 15 defaulting to the C23 language dialect.
> 
> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>

Applied to 2025.02.x & 2025.05.x. Thanks

> ---
> 
> Tested on an Acmesystems Acqua board.
> 
> Also build-tested with a 2×2×2 test matrix:
>  - GCC version:        14, 15
>  - patch included:     no, yes
>  - bootloader version: v3.10.3, v4.0.0
> as expected, all tests passed save for those with GCC 15 without the patch.
> 
>  ...conditionally-define-bool-false-and-.patch | 47 +++++++++++++++++++
>  ...conditionally-define-bool-false-and-.patch | 46 ++++++++++++++++++
>  2 files changed, 93 insertions(+)
>  create mode 100644 boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
>  create mode 100644 boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch
> 
> diff --git a/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch b/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
> new file mode 100644
> index 0000000000..d4e37a86f6
> --- /dev/null
> +++ b/boot/at91bootstrap3/v3.10.3/0001-include-types.h-conditionally-define-bool-false-and-.patch
> @@ -0,0 +1,47 @@
> +From 908c65678867565a934ea5a967bfe7e204d1ccaf Mon Sep 17 00:00:00 2001
> +From: Edgar Bonet <bonet@grenoble.cnrs.fr>
> +Date: Wed, 25 Jun 2025 11:13:43 +0200
> +Subject: [PATCH] include/types.h: conditionally define bool, false and true
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +include/types.h typedefs ‘bool’ and macro-defines ‘false’ and ‘true’.
> +However, since C23, these are predefine keywords. As C23 is the default
> +C dialect for GCC 15, building with this compiler fails with:
> +
> +    include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
> +       23 | typedef unsigned char bool;
> +          |                       ^~~~
> +    include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
> +
> +Fix this build failure by only defining ‘bool’, ‘false’ and ‘true’ on C
> +dialects older than C23.
> +
> +Upstream: https://github.com/linux4sam/at91bootstrap/pull/188
> +
> +Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
> +(cherry picked from commit 4aab60e634d588dffbd3154fd0cfce78272b750a)
> +---
> + include/types.h | 3 +++
> + 1 file changed, 3 insertions(+)
> +
> +diff --git a/include/types.h b/include/types.h
> +index 1246a4df..2c1a41cf 100644
> +--- a/include/types.h
> ++++ b/include/types.h
> +@@ -42,8 +42,11 @@ typedef signed long long s64;
> + typedef unsigned long size_t;
> + typedef signed long ssize_t;
> + 
> ++/* bool, false and true are predefined since C23. */
> ++#if __STDC_VERSION__ < 202311L
> + typedef unsigned char bool;
> + #define false	0U
> + #define true	1U
> ++#endif
> + 
> + #endif /* TYPES_H_ */
> +-- 
> +2.43.0
> +
> diff --git a/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch b/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch
> new file mode 100644
> index 0000000000..772a808690
> --- /dev/null
> +++ b/boot/at91bootstrap3/v4.0.0/0001-include-types.h-conditionally-define-bool-false-and-.patch
> @@ -0,0 +1,46 @@
> +From 4aab60e634d588dffbd3154fd0cfce78272b750a Mon Sep 17 00:00:00 2001
> +From: Edgar Bonet <bonet@grenoble.cnrs.fr>
> +Date: Wed, 25 Jun 2025 11:13:43 +0200
> +Subject: [PATCH] include/types.h: conditionally define bool, false and true
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +include/types.h typedefs ‘bool’ and macro-defines ‘false’ and ‘true’.
> +However, since C23, these are predefine keywords. As C23 is the default
> +C dialect for GCC 15, building with this compiler fails with:
> +
> +    include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
> +       23 | typedef unsigned char bool;
> +          |                       ^~~~
> +    include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
> +
> +Fix this build failure by only defining ‘bool’, ‘false’ and ‘true’ on C
> +dialects older than C23.
> +
> +Upstream: https://github.com/linux4sam/at91bootstrap/pull/188
> +
> +Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
> +---
> + include/types.h | 3 +++
> + 1 file changed, 3 insertions(+)
> +
> +diff --git a/include/types.h b/include/types.h
> +index 950b1a46..0ad9ae61 100644
> +--- a/include/types.h
> ++++ b/include/types.h
> +@@ -20,8 +20,11 @@ typedef signed long long s64;
> + typedef unsigned long size_t;
> + typedef signed long ssize_t;
> + 
> ++/* bool, false and true are predefined since C23. */
> ++#if __STDC_VERSION__ < 202311L
> + typedef unsigned char bool;
> + #define false	0U
> + #define true	1U
> ++#endif
> + 
> + #endif /* TYPES_H_ */
> +-- 
> +2.43.0
> +
> -- 
> 2.34.1
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/1] boot/at91bootstrap3: fix build with host GCC 15
  2025-07-11 10:44 ` Thomas Perale via buildroot
@ 2025-07-11 11:07   ` Baruch Siach via buildroot
  2025-07-11 12:02     ` Edgar Bonet via buildroot
  0 siblings, 1 reply; 6+ messages in thread
From: Baruch Siach via buildroot @ 2025-07-11 11:07 UTC (permalink / raw)
  To: Thomas Perale via buildroot; +Cc: Edgar Bonet, Thomas Perale

Hi Tomas,

On Fri, Jul 11 2025, Thomas Perale via buildroot wrote:
> In reply of:
>> Building at91bootstrap3 with GCC15 fails with:
>> 
>>     include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
>>        23 | typedef unsigned char bool;
>>           |                       ^~~~
>>     include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
>> 
>> This is due to GCC 15 defaulting to the C23 language dialect.
>> 
>> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
>
> Applied to 2025.02.x & 2025.05.x. Thanks

Not in 2025.02.x as of commit 946b7ff2280aa
("support/dependencies/check-host-cmake.mk: set host-cmake max
version").

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/1] boot/at91bootstrap3: fix build with host GCC 15
  2025-07-11 11:07   ` Baruch Siach via buildroot
@ 2025-07-11 12:02     ` Edgar Bonet via buildroot
  0 siblings, 0 replies; 6+ messages in thread
From: Edgar Bonet via buildroot @ 2025-07-11 12:02 UTC (permalink / raw)
  To: buildroot

Hello everybody!

On 11/07/2025 13:07, Baruch Siach via buildroot wrote:
> Hi Tomas,
> 
> On Fri, Jul 11 2025, Thomas Perale via buildroot wrote:
>> In reply of:
>>> Building at91bootstrap3 with GCC15 fails with:
>>>
>>>     include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
>>>        23 | typedef unsigned char bool;
>>>           |                       ^~~~
>>>     include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
>>>
>>> This is due to GCC 15 defaulting to the C23 language dialect.
>>>
>>> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
>>
>> Applied to 2025.02.x & 2025.05.x. Thanks
> 
> Not in 2025.02.x as of commit 946b7ff2280aa
> ("support/dependencies/check-host-cmake.mk: set host-cmake max
> version").

Indeed, but 2025.02.x does not support GCC 15 anyway.

Regards,

Edgar.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-11 12:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 10:15 [Buildroot] [PATCH 1/1] boot/at91bootstrap3: fix build with host GCC 15 Edgar Bonet via buildroot
2025-07-06 16:02 ` Romain Naour via buildroot
2025-07-06 16:43   ` Edgar Bonet via buildroot
2025-07-11 10:44 ` Thomas Perale via buildroot
2025-07-11 11:07   ` Baruch Siach via buildroot
2025-07-11 12:02     ` Edgar Bonet via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox