[PATCH] fix testcase with non-constant initializer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These 2 top-level declarations had a non-constant initializer.

Fix that by moving thme into a function.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/nocast.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/validation/nocast.c b/validation/nocast.c
index 6c5da968776b..cabcff622676 100644
--- a/validation/nocast.c
+++ b/validation/nocast.c
@@ -26,9 +26,11 @@ static ulong_nc_t good_deref(ulong_nc_t *t)
 
 /* assign value */
 static ulong_nc_t t;
-static ulong_nc_t good_assign_self = t;
-static unsigned long good_assign_sametype = t;
-
+static void assign_value(void)
+{
+	ulong_nc_t good_assign_self = t;
+	unsigned long good_assign_sametype = t;
+}
 /* assign pointer */
 static ulong_nc_t *good_ptr = &t;
 static ulong_nc_t *bad_ptr_to = 1UL;
-- 
2.24.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux