summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/malloctest
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-11-19 13:57:37 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-11-20 12:57:33 -0600
commit163519a055c355a5ae023122f43f68395dee2c2f (patch)
treef0d7c9c0237c90547fa060ae5d910574b07c8cdf /testsuites/libtests/malloctest
parentlibdl/rtl-mdreloc-powerpc.c: Fix warnings (diff)
downloadrtems-163519a055c355a5ae023122f43f68395dee2c2f.tar.bz2
libtests/malloctest/init.c: Fix warning
posix_memalign() is prototyped to take a non-NULL parameter. But our test is deliberately passing one in. With the -Wnon-null warning flag enabled, we will always get warnings on this test unless we disable that warning for this single test case.
Diffstat (limited to 'testsuites/libtests/malloctest')
-rw-r--r--testsuites/libtests/malloctest/init.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c
index 0d95e3b9f1..399cdd5dc9 100644
--- a/testsuites/libtests/malloctest/init.c
+++ b/testsuites/libtests/malloctest/init.c
@@ -1,17 +1,5 @@
-/* Init
- *
- * This routine is the initialization task for this test program.
- * It is a user initialization task and has the responsibility for creating
- * and starting the tasks that make up the test. If the time of day
- * clock is required for the test, it should also be set to a known
- * value by this function.
- *
- * Input parameters:
- * argument - task argument
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-2011.
+/*
+ * COPYRIGHT (c) 1989-2011, 2014.
* On-Line Applications Research Corporation (OAR).
*
* Copyright (c) 2009, 2010 embedded brains GmbH.
@@ -1188,9 +1176,17 @@ static void test_posix_memalign(void)
int sc;
int maximumShift;
+ /*
+ * posix_memalign() is declared as never having a NULL first parameter.
+ * We need to explicitly disable this compiler warning to make this code
+ * warning free.
+ */
+ COMPILER_DIAGNOSTIC_SETTINGS_PUSH
+ COMPILER_DIAGNOSTIC_SETTINGS_DISABLE_NONNULL
puts( "posix_memalign - NULL return pointer -- EINVAL" );
sc = posix_memalign( NULL, 32, 8 );
fatal_posix_service_status( sc, EINVAL, "posix_memalign NULL pointer" );
+ COMPILER_DIAGNOSTIC_SETTINGS_POP
puts( "posix_memalign - alignment of 0 -- EINVAL" );
sc = posix_memalign( &p1, 0, 8 );