This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: FYI: Small build fix for unusual configuration
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 11 Apr 2011 13:35:28 -0400
- Subject: Re: FYI: Small build fix for unusual configuration
Hi Petr,
> This might be just shifting the problem into the future, but this
> works with less code and will make it easier to add more formats,
> should that be necessary:
>
> > for (size_t i = 0;
> >- i < sizeof vmlinux_suffixes / sizeof vmlinux_suffixes[0];
> >+ i + 1 < (sizeof vmlinux_suffixes / sizeof vmlinux_suffixes[0]) + 1;
Yeah, Frank did point out that if you make the code less specific
and mark i as int, then the compiler also isn't smart enough to
notice that the comparison is always true when the array is empty.
Feel free to replace my solution with something simpler if you think
that is more clear. My fix might have been a tad too "pedantically
correct".
Thanks,
Mark