This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Fix compiler warnings in osabi.c
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 11 Jan 2006 06:22:09 +0200
- Subject: Re: [RFC] Fix compiler warnings in osabi.c
- References: <200601102222.k0AMMNSq000979@elgar.sibelius.xs4all.nl>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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?