[PATCH 2/3] bfd: guard ARCH_SIZE uses to avoid -Wundef
Jan Beulich
jbeulich@suse.com
Mon Sep 15 02:56:40 GMT 2025
On 14.09.2025 21:52, Andrew Hanson wrote:
> * bfd/elf-bfd.h: Use `#if defined(ARCH_SIZE) && (ARCH_SIZE == 64)` and
> `#elif defined(ARCH_SIZE) && (ARCH_SIZE == 32)` instead of testing
> `ARCH_SIZE` directly, to silence -Wundef when ARCH_SIZE is not defined.
The code change itself if okay (I probably would have used a single
#if !defined() first, doing nothing, followed by #elif), but the
ChangeLog entry is malformed (and hence, aiui, wouldn't be recognized
as such). You need bfd/ on a line of its own to indicate which
ChangeLog file is meant. However, the description could also be
written as an actual description, and the wording you use actually
suggests that would be the better thing here.
As this may need committing on your behalf anyway, I could do the
adjustment while committing, provided you're okay with me doing so.
One legal question though - there was no S-o-b here; do you have
licensing paperwork in place with the FSF? The change here is small
enough that it probably could go in without, but taking the three
patches together I'm already not as certain.
Jan
> --- a/bfd/elf-bfd.h
> +++ b/bfd/elf-bfd.h
> @@ -47,10 +47,9 @@ extern "C" {
>
> /* If size isn't specified as 64 or 32, NAME macro should fail. */
> #ifndef NAME
> -#if ARCH_SIZE == 64
> +#if defined(ARCH_SIZE) && ARCH_SIZE == 64
> #define NAME(x, y) x ## 64 ## _ ## y
> -#endif
> -#if ARCH_SIZE == 32
> +#elif defined(ARCH_SIZE) && ARCH_SIZE == 32
> #define NAME(x, y) x ## 32 ## _ ## y
> #endif
> #endif
More information about the Binutils
mailing list