diff options
author | Cyril Bur <cyril.bur@au1.ibm.com> | 2016-07-14 11:58:52 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-07-18 16:04:17 +1000 |
commit | d314ddf5d9e167108ccddf0ed1cdb3cc0f25d443 (patch) | |
tree | 1ac8a69c8c82aba173ede82af46a678e6d531a0d /libc/stdio | |
parent | 8f542322613e06ea9340772c2995975e642c2c48 (diff) | |
download | skiboot-d314ddf5d9e167108ccddf0ed1cdb3cc0f25d443.zip skiboot-d314ddf5d9e167108ccddf0ed1cdb3cc0f25d443.tar.gz skiboot-d314ddf5d9e167108ccddf0ed1cdb3cc0f25d443.tar.bz2 |
libc: Remove NULL check for format argument in snprintf()
libc printf style functions are annotated with __attribute__((format
(printf, x, y))) which causes GCC to perform compile time checks
against these arguments.
As of at least gcc 6.1.1 [(GCC) 6.1.1 20160602] this causes an error
running make check. GCC appears to be guaranteeing that the format
argument won't be NULL and complaining about explicit checks.
In file included from core/test/run-console-log-buf-overrun.c:48:0:
core/test/run-console-log-buf-overrun.c: In function ‘snprintf’:
core/test/../../libc/stdio/snprintf.c:21:19: error: nonnull argument
‘format’compared to NULL [-Werror=nonnull-compare]
if ((buff==NULL) || (format==NULL))
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors make:
*** [core/test/Makefile.check:59:core/test/run-console-log-buf-overrun] Error 1
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libc/stdio')
-rw-r--r-- | libc/stdio/snprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/stdio/snprintf.c b/libc/stdio/snprintf.c index cc1cc0f..35b6f86 100644 --- a/libc/stdio/snprintf.c +++ b/libc/stdio/snprintf.c @@ -18,7 +18,7 @@ int snprintf(char *buff, size_t size, const char *format, ...) va_list ar; int count; - if ((buff==NULL) || (format==NULL)) + if (buff==NULL) return(-1); va_start(ar, format); |