[binutils-gdb] bfd: guard ARCH_SIZE uses to avoid -Wundef

Jan Beulich jbeulich@sourceware.org
Fri Sep 26 10:24:50 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=951df7206e969a8f49f87707121fa1ef93268c28

commit 951df7206e969a8f49f87707121fa1ef93268c28
Author: Andrew Hanson <andrew@andrewhanson.dev>
Date:   Fri Sep 26 12:22:37 2025 +0200

    bfd: guard ARCH_SIZE uses to avoid -Wundef
    
    bfd/
    
            * elf-bfd.h: Use `defined(ARCH_SIZE)` instead of testing ARCH_SIZE
            directly, to silence -Wundef when ARCH_SIZE is not defined.
    
    Signed-off-by: Andrew Hanson <andrew@andrewhanson.dev>

Diff:
---
 bfd/elf-bfd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 51e6ae7bb78..9ce81ebd314 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -46,7 +46,7 @@ extern "C" {
 #define NUM_SHDR_ENTRIES(shdr) ((shdr)->sh_entsize > 0 ? (shdr)->sh_size / (shdr)->sh_entsize : 0)
 
 /* If size isn't specified as 64 or 32, NAME macro should fail.  */
-#ifndef NAME
+#if !defined(NAME) && defined(ARCH_SIZE)
 #if ARCH_SIZE == 64
 #define NAME(x, y) x ## 64 ## _ ## y
 #endif


More information about the Binutils-cvs mailing list