[PATCH 1/2] testcase: make the -vcompound testcase standalone

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

 



Testcases depending on standard headers are problematic
because it often creates problems unrelated to the case being
tested but caused by unsupported features or assumptions made
in these headers on some platforms.

In the present test, stdlib.h & stdint.h are included for NULL,
uint32_t & uint64_t.

Avoid the dependency by defining these symbols locally.

CC: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/compound-sizes.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/validation/compound-sizes.c b/validation/compound-sizes.c
index 35a248fdc..3d36f3eda 100644
--- a/validation/compound-sizes.c
+++ b/validation/compound-sizes.c
@@ -1,7 +1,7 @@
 // This tests sparse "-vcompound" output.
-
-#include <stdlib.h>
-#include <stdint.h>
+#define NULL ((void*)0)
+typedef unsigned int       uint32_t;
+typedef unsigned long long uint64_t;
 
 // Do not list functions.
 static int do_nothing(void)
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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