diff --git a/stress-ng-c99-1.patch b/stress-ng-c99-1.patch new file mode 100644 index 0000000..db837b5 --- /dev/null +++ b/stress-ng-c99-1.patch @@ -0,0 +1,21 @@ +test-pidfd-getfd: Include if available for pidfd_getfd + +Submitted upstream: + + + +diff --git a/test/test-pidfd-getfd.c b/test/test-pidfd-getfd.c +index d55b6f9a28692417..317c5542b2c423ee 100644 +--- a/test/test-pidfd-getfd.c ++++ b/test/test-pidfd-getfd.c +@@ -20,6 +20,10 @@ + + #define _GNU_SOURCE + ++#if defined(__has_include) && __has_include() ++#include ++#endif ++ + int main(void) + { + /* We don't care about the args, we just want to see if it links */ diff --git a/stress-ng-c99-2.patch b/stress-ng-c99-2.patch new file mode 100644 index 0000000..cf61944 --- /dev/null +++ b/stress-ng-c99-2.patch @@ -0,0 +1,26 @@ +test/test-float.c: Avoid tickling an implicit int error + +The new typedef ensures that ftype is known as a type, even if FLOAT +itself does not denote a type. This helps with efforts porting to +modern C, where all implicit ints are flagged for investigation. + +Submitted upstream: + + + +diff --git a/test/test-float.c b/test/test-float.c +index 06cb7f651fc7eb90..0483c9b587d9a4c3 100644 +--- a/test/test-float.c ++++ b/test/test-float.c +@@ -58,7 +58,10 @@ + b = d - (_type)1.0L; \ + } while (0) + +-static FLOAT HOT OPTIMIZE3 test(void) ++/* Avoid implicit int in the definition of test even if FLOAT is not known. */ ++typedef FLOAT float_type; ++ ++static float_type HOT OPTIMIZE3 test(void) + { + FLOAT a = 0.0, b = 0.0, c = 0.0, d = 0.0; + diff --git a/stress-ng-c99-3.patch b/stress-ng-c99-3.patch new file mode 100644 index 0000000..455ae2d --- /dev/null +++ b/stress-ng-c99-3.patch @@ -0,0 +1,19 @@ +test-fchmodat: Include for the fchmodat prototype + +Submitted upstream: + + + +diff --git a/test/test-fchmodat.c b/test/test-fchmodat.c +index 7a8f59de42716057..209e6841f3a738f1 100644 +--- a/test/test-fchmodat.c ++++ b/test/test-fchmodat.c +@@ -18,7 +18,7 @@ + * + */ + +-#include ++#include + + int main(void) + { diff --git a/stress-ng-c99-4.patch b/stress-ng-c99-4.patch new file mode 100644 index 0000000..8808de9 --- /dev/null +++ b/stress-ng-c99-4.patch @@ -0,0 +1,20 @@ +test-aligned-alloc: Define _GNU_SOURCE for the aligned_alloc prototype + +Submitted upstream: + + + +diff --git a/test/test-aligned-alloc.c b/test/test-aligned-alloc.c +index 0ea91b6a7ccadf12..f29365530b9e5e52 100644 +--- a/test/test-aligned-alloc.c ++++ b/test/test-aligned-alloc.c +@@ -16,6 +16,9 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ ++ ++#define _GNU_SOURCE ++ + #include + + int main(void) diff --git a/stress-ng.spec b/stress-ng.spec index ed9b132..ed4bd3e 100644 --- a/stress-ng.spec +++ b/stress-ng.spec @@ -1,11 +1,15 @@ Name: stress-ng Version: 0.15.00 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Stress test a computer system in various ways License: GPLv2+ URL: https://github.com/ColinIanKing/stress-ng Source0: https://github.com/ColinIanKing/stress-ng/archive/V%{version}/%{name}-%{version}.tar.gz +Patch0: stress-ng-c99-1.patch +Patch1: stress-ng-c99-2.patch +Patch2: stress-ng-c99-3.patch +Patch3: stress-ng-c99-4.patch BuildRequires: make BuildRequires: gcc @@ -28,7 +32,7 @@ various physical subsystems of a computer as well as the various operating system kernel interfaces. %prep -%autosetup -n %{name}-%{version} +%autosetup -p1 -n %{name}-%{version} %build %make_build @@ -50,6 +54,9 @@ install -pm 644 bash-completion/%{name} \ %{_datadir}/bash-completion/completions/%{name} %changelog +* Tue Dec 13 2022 Florian Weimer - 0.15.00-2 +- Improve compatibility with strict(er) C99 compilers + * Wed Dec 07 2022 Fabio Alessandro Locati - 0.15.00-1 - Update to 0.15.00