diff --git a/systemtap-support-wimplicit-fallthrough-gen_map.patch b/systemtap-support-wimplicit-fallthrough-gen_map.patch new file mode 100644 index 0000000..e3e5b74 --- /dev/null +++ b/systemtap-support-wimplicit-fallthrough-gen_map.patch @@ -0,0 +1,24 @@ +Author: Frank Ch. Eigler +Date: Thu Nov 7 13:47:34 2019 -0500 +Subject: runtime gen-map.c: add /* fallthru */ to satisfy gcc 9's -Wimplicit-fallthrough +Git-commit: c4034101819829b6fb6cea38474c76fd50fa9eda +References: none (found during testing of SLE15-SP2 v4.1 update) +Signed-off-by: Tony Jones + + + runtime gen-map.c: add /* fallthru */ to satisfy gcc 9's -Wimplicit-fallthrough + +diff --git a/runtime/map-gen.c b/runtime/map-gen.c +index 413e20edb..d8fc48710 100644 +--- a/runtime/map-gen.c ++++ b/runtime/map-gen.c +@@ -112,7 +112,9 @@ + k1 = 0; \ + switch(mylen & 3) { \ + case 3: k1 ^= tail[2] << 16; \ ++ /* fallthrough */ \ + case 2: k1 ^= tail[1] << 8; \ ++ /* fallthrough */ \ + case 1: k1 ^= tail[0]; \ + k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1; \ + } \ diff --git a/systemtap-support-wimplicit-fallthrough-vsprintf.patch b/systemtap-support-wimplicit-fallthrough-vsprintf.patch new file mode 100644 index 0000000..fb794cc --- /dev/null +++ b/systemtap-support-wimplicit-fallthrough-vsprintf.patch @@ -0,0 +1,47 @@ +From: Frank Ch. Eigler +Date: Sun Aug 11 15:00:27 2019 +0000 +Subject: add /* fallthru */ to satisfy gcc 9's -Wimplicit-fallthrough +Git-commit: 910acbe2663d7432e38ee3563c56dfd10b05b7db +References: none (found during testing of SLE15-SP2 v4.1 update) +Signed-off-by: Tony Jones + + rhbz1737589: add /* fallthru */ to satisfy gcc 9's -Wimplicit-fallthrough + + We need annotate switch statements with deliberate case-to-case fallthroughs. + +diff --git a/runtime/vsprintf.c b/runtime/vsprintf.c +index 7bae9f841..388a87110 100644 +--- a/runtime/vsprintf.c ++++ b/runtime/vsprintf.c +@@ -639,6 +639,7 @@ _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + + case 'X': + flags |= STP_LARGE; ++ /* fallthru */ + case 'x': + base = 16; + break; +@@ -646,6 +647,7 @@ _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + case 'd': + case 'i': + flags |= STP_SIGN; ++ /* fallthru */ + case 'u': + break; + +@@ -826,6 +828,7 @@ _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + + case 'X': + flags |= STP_LARGE; ++ /* fallthru */ + case 'x': + base = 16; + break; +@@ -833,6 +836,7 @@ _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args) + case 'd': + case 'i': + flags |= STP_SIGN; ++ /* fallthru */ + case 'u': + break; + diff --git a/systemtap.changes b/systemtap.changes index 4836b0a..440a033 100644 --- a/systemtap.changes +++ b/systemtap.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Nov 7 18:18:07 UTC 2019 - Tony Jones + +- Add support for gcc -Wimplicit-fallthrough to resolve compilation errors + of the form "this statement may fall through" + New patch: systemtap-support-wimplicit-fallthrough-vsprintf.patch + New patch: systemtap-support-wimplicit-fallthrough-gen_map.patch + ------------------------------------------------------------------- Mon Oct 14 07:32:43 UTC 2019 - Martin Pluskal diff --git a/systemtap.spec b/systemtap.spec index 9f6f96c..8401a60 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -33,6 +33,8 @@ Source3: README-BEFORE-ADDING-PATCHES Source4: README-KEYRING Source5: stap-server.conf Patch1: systemtap-build-source-dir.patch +Patch2: systemtap-support-wimplicit-fallthrough-vsprintf.patch +Patch3: systemtap-support-wimplicit-fallthrough-gen_map.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ @@ -95,6 +97,8 @@ This package contains the support tools for static probes. %prep %setup -q %patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build autoreconf -fi