[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
coreutils snapshot vs gcc7-to-be: new test-calloc-gnu.c and test-canonic
From: |
Jim Meyering |
Subject: |
coreutils snapshot vs gcc7-to-be: new test-calloc-gnu.c and test-canonicalize.c warnings |
Date: |
Fri, 3 Mar 2017 16:30:49 -0800 |
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)
^~~~~~
and this:
test-canonicalize.c: In function 'main':
test-canonicalize.c:78:13: error: argument 1 null where non-null
expected [-Werror=nonnull]
result1 = canonicalize_file_name (null_ptr ());
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../lib/stdlib.h:36:0,
from ../lib/canonicalize.h:20,
from test-canonicalize.c:21:
/usr/include/stdlib.h:723:14: note: in a call to function
'canonicalize_file_name' declared here
extern char *canonicalize_file_name (const char *__name)
^~~~~~~~~~~~~~~~~~~~~~
- coreutils snapshot vs gcc7-to-be: new test-calloc-gnu.c and test-canonicalize.c warnings,
Jim Meyering <=