ebbc582912
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
27 lines
804 B
Diff
27 lines
804 B
Diff
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:
|
|
|
|
<https://github.com/ColinIanKing/stress-ng/pull/247>
|
|
|
|
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;
|
|
|