[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils snapshot vs gcc7-to-be: new test-calloc-gnu.c and test-can
From: |
Jim Meyering |
Subject: |
Re: coreutils snapshot vs gcc7-to-be: new test-calloc-gnu.c and test-canonicalize.c warnings |
Date: |
Sat, 4 Mar 2017 14:54:11 -0800 |
On Fri, Mar 3, 2017 at 4:30 PM, Jim Meyering <address@hidden> wrote:
> Building the latest coreutils snapshot with gcc just built from its
> own latest git, I hit this:
>
> test-calloc-gnu.c: In function 'main':
> test-calloc-gnu.c:32:5: warning: product '2305843009213693952 * 8'
> of arguments 1 and 2 exceeds 'SIZE_MAX' [-Walloc-size-larger-than=]
> p = calloc ((size_t) -1 / 8 + 1, 8);
> ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from ../lib/stdlib.h:36:0,
> from test-calloc-gnu.c:19:
> /usr/include/stdlib.h:467:14: note: in a call to allocation function
> 'calloc' declared here
> extern void *calloc (size_t __nmemb, size_t __size)
> ^~~~~~
I've just fixed that with the attached and just-pushed gnulib patch:
gnulib-port-calloc-test-to-GCC7.diff
Description: Text document