This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] libdwfl: Fix wrong type to make gcc -fsanitize=undefined happy.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 22 Apr 2015 13:59:26 +0200
- Subject: Re: [PATCH] libdwfl: Fix wrong type to make gcc -fsanitize=undefined happy.
Hi Roland,
On Tue, 2015-04-21 at 13:26 -0700, Roland McGrath wrote:
> I think it's cleaner to do:
>
> [PATCH] libdwfl: Make dwfl_error.c C99-kosher.
>
> +2015-04-21 Roland McGrath <roland@hack.frob.com>
> +
> + * dwfl_error.c (struct msgtable): Break type definition out of
> + the 'msgtable' initializer.
> + (msgtable): Make it a union of struct msgtable and a char array.
> + (msgstr): Use the full-table char array rather than the msg_0 entry.
Yes, much nicer. I hadn't thought of using a union and expand the
DWFL_ERRORS twice. Nice trick.
> --- a/libdwfl/dwfl_error.c
> +++ b/libdwfl/dwfl_error.c
> @@ -1,5 +1,5 @@
> /* Error handling in libdwfl.
> - Copyright (C) 2005-2010 Red Hat, Inc.
> + Copyright (C) 2005-2015 Red Hat, Inc.
> This file is part of elfutils.
I know you are nostalgic :) But no need to assign copyright to Red Hat.
Just add your own copyright notice to the file.
Thanks,
Mark