[3/3] binutils: fix -std=gnu23 compatibility wrt _Bool

Message ID a6cd9bf5b8ff81d9f07a9f7ca36fa8b0f23e5dee.1731738744.git.sam@gentoo.org
State New
Headers
Series C23 fixes |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed

Commit Message

Sam James Nov. 16, 2024, 6:32 a.m. UTC
  GCC trunk now defaults to -std=gnu23. We return false in a few places
which can't work when true/false are a proper type (_Bool). Return NULL
where appropriate instead of false. All callers handle this appropriately.

ChangeLog:
	PR ld/32372

	* binutils/prdbg.c (visibility_name): Return NULL.
---
 binutils/prdbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

H.J. Lu Nov. 16, 2024, 7:03 a.m. UTC | #1
On Sat, Nov 16, 2024 at 2:35 PM Sam James <sam@gentoo.org> wrote:
>
> GCC trunk now defaults to -std=gnu23. We return false in a few places
> which can't work when true/false are a proper type (_Bool). Return NULL
> where appropriate instead of false. All callers handle this appropriately.
>
> ChangeLog:
>         PR ld/32372
>
>         * binutils/prdbg.c (visibility_name): Return NULL.

No binutils/ prefix.

> ---
>  binutils/prdbg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/binutils/prdbg.c b/binutils/prdbg.c
> index 3941d6e1791..d6e828ee545 100644
> --- a/binutils/prdbg.c
> +++ b/binutils/prdbg.c
> @@ -2818,7 +2818,7 @@ visibility_name (enum debug_visibility visibility)
>        break;
>      default:
>        abort ();
> -      return false;
> +      return NULL;
>      }
>    return s;
>  }
> --
> 2.47.0
>
  

Patch

diff --git a/binutils/prdbg.c b/binutils/prdbg.c
index 3941d6e1791..d6e828ee545 100644
--- a/binutils/prdbg.c
+++ b/binutils/prdbg.c
@@ -2818,7 +2818,7 @@  visibility_name (enum debug_visibility visibility)
       break;
     default:
       abort ();
-      return false;
+      return NULL;
     }
   return s;
 }