This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 1/2] objcopy/strip: Allow section patterns starting with '!'.
On Thu, Jul 14, 2016 at 10:41:26AM +0100, Andrew Burgess wrote:
> * Alan Modra <amodra@gmail.com> [2016-07-14 18:19:24 +0930]:
> > On Thu, Jul 14, 2016 at 09:26:47AM +0100, Andrew Burgess wrote:
> > > - else if ((p->context & context)
> > > - /* We could check for the presence of wildchar characters
> > > - first and choose between calling strcmp and fnmatch,
> > > - but is that really worth it ? */
> > > - && fnmatch (p->pattern, name, 0) == 0)
> > > - {
> > > - p->used = TRUE;
> > > - return p;
> > > - }
> > > + else if (p->context & context)
> >
> > I suspect this will cause a gcc warning and thus build failure.
> > Patch is OK once you've corrected these errors.
>
> I'm a little surprised given that this is not actually new code, just
> old code moved. Not only that but there's plenty of similar example
> of the same construct in the same function.
Yes, but the bitwise-and expression was previously wrapped in
"unnecessary" parentheses.
> I tried compiling with -Wall -Werror on GCC 5.3.1, without warnings or
> errors. Are you expecting that the code should become:
>
> else if ((p->context & context) != 0)
Yes, but it seems I was wrong. I ran a few quick checks on a range of
compilers and found no warning, so as you had it is fine.
--
Alan Modra
Australia Development Lab, IBM