[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] inttostr: simplify by removing unnecessary redundancy

From: Eric Blake
Subject: Re: [PATCH] inttostr: simplify by removing unnecessary redundancy
Date: Fri, 22 Oct 2010 14:09:30 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100921 Fedora/3.1.4-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.4

On 10/22/2010 01:23 PM, Jim Meyering wrote:
Paul Eggert wrote:
> From 3a77a23690108e721b8b99f947937bda9026ee07 Mon Sep 17 00:00:00 2001
From: Paul Eggert<address@hidden>
Date: Fri, 22 Oct 2010 11:14:17 -0700
Subject: [PATCH] inttostr: simplify by removing unnecessary redundancy

While looking into the inttostr issues raised recently, I discovered
that an #if would be a bit cleaner if rewritten as an if (as per
Spencer&  Collyer's classic paper #ifdef Considered Harmful), and
installed this:

* lib/anytostr.c: Don't include verify.h.
(anytostr): Don't verify that TYPE_SIGNED (inttype) equals
inttype_is_signed.  Instead, use TYPE_SIGNED (inttype) directly.

     cc1: warnings being treated as errors
     In file included from uinttostr.c:4:
     anytostr.c: In function 'uinttostr':
     anytostr.c:34: error: comparison of unsigned expression<  0 is always 
false [-Wtype-limits]
     make[4]: *** [uinttostr.o] Error 1

With your change, that warning (and with -Werror, failure) is back.

Can we at least factor things, so that inttype_is_signed is computed within the body of anytostr.c rather than being a required parameter of each wrapper? That way, we can still avoid verify, because the computation and use would reside in the same file.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]