[RFC] Fix compiler warnings in osabi.c

Eli Zaretskii eliz@gnu.org
Wed Jan 11 04:22:00 GMT 2006


> Date: Tue, 10 Jan 2006 23:22:23 +0100 (CET)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> 
> -      if (strcmp (&elf_elfheader (abfd)->e_ident[8], "FreeBSD") == 0)
> +      if (memcmp (&elf_elfheader (abfd)->e_ident[8], "FreeBSD", 8) == 0)

I'm allergic to magic constants such as 8.  Can we please make that
use sizeof("FreeBSD")?  To avoid having two instances of "FreeBSD" in
the code, you could use a `const char []' variable with "FreeBSD" as
its value.

WDYT?



More information about the Gdb-patches mailing list