Re: [SCM] GNU M4 source repository branch, branch-1.4, updated. v1.4.16-3-gfb132bf
"Gary V. Vaughan" <[email protected]> Sun, 1 May 2011 00:48:57 +0700
| Newsgroups | gmane.comp.gnu.m4.patches |
|---|---|
| Message-ID | <[email protected]> |
Hi Eric,
On Sat, Apr 30, 2011 at 07:18:49AM -0600, Eric Blake wrote:
> On 04/30/2011 01:16 AM, Gary V. Vaughan wrote:
> >> argc is an int, therefore by definition, it is <= INT_MAX.
> >>
> >> - assert (0 < argc && argc <= INT_MAX);
> >> + assert (0 < argc);
> >> for (i = 1; i < (unsigned) argc; i++)
> >> {
> >> const char *arg = ARG((int) i);
> >
> > Since argc is immediately cast to an unsigned int, I think the test was
> > supposed to be:
> >
> > assert (0 < argc && argc <= UINT_MAX);
>
> Except that INT_MAX < UINT_MAX, so that's also redundant. The real
> trick was that gcc was issuing spurious warnings if it didn't have proof
> that argc was positive, so all we really needed was the (0 < argc) term;
> my mistake in the earlier patch was adding a redundant term at the same
> time.
Quite right. I guess lack of caffeine was affecting my sense of logic.
Sorry for the noise.
Cheers,
--
Gary V. Vaughan (gary AT gnu DOT org)
_______________________________________________
M4-patches mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/m4-patches
signature.asc
(application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk28S4gACgkQFRMICSmD1ga0GACgkv5AO6tbA2xglivVYUg331Tx CQ4An0bZBB7T66siICuDoDR5qOOqy/yL =5klg -----END PGP SIGNATURE-----