!4 Fix the error of using parameter (%s, NULL) for 'printf' when built by gcc-9
Merge pull request !4 from 成子晗/master
This commit is contained in:
commit
d45d322d9a
43
gcc-9-stricter-on-NULL-arguments-for-printf.patch
Normal file
43
gcc-9-stricter-on-NULL-arguments-for-printf.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From 6fa1497436693b2a2d8577dcae86a2bebca5b3f3 Mon Sep 17 00:00:00 2001
|
||||
From: chengzihan2 <chengzihan1111@163.com>
|
||||
Date: Tue, 2 Jun 2020 10:57:02 +0800
|
||||
Subject: [PATCH] gcc-9 stricter on NULL arguments for printf
|
||||
|
||||
---
|
||||
lib/libvarnish/vnum.c | 20 +++++++++++---------
|
||||
1 file changed, 11 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/lib/libvarnish/vnum.c b/lib/libvarnish/vnum.c
|
||||
index 6caf931..2611768 100644
|
||||
--- a/lib/libvarnish/vnum.c
|
||||
+++ b/lib/libvarnish/vnum.c
|
||||
@@ -348,15 +348,17 @@ main(int argc, char *argv[])
|
||||
|
||||
for (tc = test_cases; tc->str; ++tc) {
|
||||
e = VNUM_2bytes(tc->str, &val, tc->rel);
|
||||
- if (e != tc->err) {
|
||||
- printf("%s: VNUM_2bytes(\"%s\", %ju) (%s) != (%s)\n",
|
||||
- *argv, tc->str, tc->rel, tc->err, e);
|
||||
- ++ec;
|
||||
- } else if (e == NULL && val != tc->val) {
|
||||
- printf("%s: VNUM_2bytes(\"%s\", %ju) %ju != %ju (%s)\n",
|
||||
- *argv, tc->str, tc->rel, val, tc->val, e);
|
||||
- ++ec;
|
||||
- }
|
||||
+ if (e != NULL)
|
||||
+ val = 0;
|
||||
+ if (e == tc->err && val == tc->val)
|
||||
+ continue;
|
||||
+ ++ec;
|
||||
+ printf("%s: VNUM_2bytes(\"%s\", %ju)\n",
|
||||
+ *argv, tc->str, tc->rel);
|
||||
+ printf("\tExpected:\tstatus %s - value %ju\n",
|
||||
+ tc->err ? tc->err : "Success", tc->val);
|
||||
+ printf("\tGot:\t\tstatus %s - value %ju\n",
|
||||
+ e ? e : "Success", val);
|
||||
}
|
||||
if (!isnan(VNUM_duration(NULL))) {
|
||||
printf("%s: VNUM_Duration(NULL) fail\n", *argv);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Name: varnish
|
||||
Summary: A web application accelerator
|
||||
Version: 6.0.0
|
||||
Release: 4
|
||||
Release: 5
|
||||
License: BSD
|
||||
URL: https://www.varnish-cache.org/
|
||||
Source0: http://varnish-cache.org/_downloads/varnish-%{version}.tgz
|
||||
@ -10,6 +10,7 @@ Source0: http://varnish-cache.org/_downloads/varnish-%{version}.tgz
|
||||
Source1: https://github.com/varnishcache/pkg-varnish-cache/archive/0ad2f22629c4a368959c423a19e352c9c6c79682/pkg-varnish-cache-0ad2f22.tar.gz
|
||||
|
||||
Patch0001: varnish-5.1.1.fix_ld_library_path_in_doc_build.patch
|
||||
Patch0002: gcc-9-stricter-on-NULL-arguments-for-printf.patch
|
||||
|
||||
BuildRequires: python3-sphinx python3-docutils pkgconfig make graphviz nghttp2 systemd-units
|
||||
BuildRequires: ncurses-devel pcre-devel libedit-devel
|
||||
@ -157,5 +158,8 @@ test -f /etc/varnish/secret || (uuidgen > /etc/varnish/secret && chmod 0600 /etc
|
||||
%{_mandir}/man7/*.7*
|
||||
|
||||
%changelog
|
||||
* Tue Jun 2 2020 chengzihan <chengzihan2@huawei.com> - 6.0.0-5
|
||||
- Fix the error of using parameter ("%s", NULL) for 'printf' when built by gcc-9
|
||||
|
||||
* Mon Feb 10 2020 wangye <wangye54@huawei.com> - 6.0.0-4
|
||||
- Init package
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user