[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140418044904.GM18016@ZenIV.linux.org.uk>
Date: Fri, 18 Apr 2014 05:49:04 +0100
From: Al Viro <viro@...IV.linux.org.uk>
To: Andi Kleen <andi@...stfloor.org>
Cc: mmarek@...e.cz, hpa@...or.com, linux-kernel@...r.kernel.org,
Andi Kleen <ak@...ux.intel.com>,
Viresh Kumar <viresh.kumar@...aro.org>
Subject: Re: [PATCH] Kbuild, lto: Avoid reported warning with strtoul
On Fri, Apr 18, 2014 at 06:35:56AM +0200, Andi Kleen wrote:
> From: Andi Kleen <ak@...ux.intel.com>
>
> Apparently someone's C library declares strtoul with warn_unused_result.
> Cast to void to avoid the warning. Error handling is not useful here.
Umm... Since we don't give a fsck for the value, isn't that simply
char *p = strchr(s, '.');
if (p) {
size_t m = strspn(p + 1, "0123456789");
if (m > 0 && (p[m + 1] == '.' || p[m + 1] == '\0'))
*p = '\0';
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists