[rtems commit] posix: Remove static assertion
Sebastian Huber
sebh at rtems.org
Tue Oct 9 10:19:06 UTC 2018
Module: rtems
Branch: master
Commit: acb53d53c900f21b5940554dfba8d7ad94f4bcba
Changeset: http://git.rtems.org/rtems/commit/?id=acb53d53c900f21b5940554dfba8d7ad94f4bcba
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Oct 9 08:43:08 2018 +0200
posix: Remove static assertion
Standard C does not allow pointer operands in an integer constant
expressions. GCC issues only a -Wpedantic warning in the removed static
assertion. However, clang is pedantic by default and issues an error.
Rely on the test case instead.
---
cpukit/posix/src/seminit.c | 2 --
testsuites/psxtests/psxsem01/init.c | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/cpukit/posix/src/seminit.c b/cpukit/posix/src/seminit.c
index 65104ad..e752a27 100644
--- a/cpukit/posix/src/seminit.c
+++ b/cpukit/posix/src/seminit.c
@@ -22,8 +22,6 @@
#include <limits.h>
-RTEMS_STATIC_ASSERT(NULL == SEM_FAILED, sem_failed);
-
/*
* 11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219
*/
diff --git a/testsuites/psxtests/psxsem01/init.c b/testsuites/psxtests/psxsem01/init.c
index dfc2ed5..899e324 100644
--- a/testsuites/psxtests/psxsem01/init.c
+++ b/testsuites/psxtests/psxsem01/init.c
@@ -193,6 +193,7 @@ static void test_sem_null(void)
int val;
struct timespec to;
+ /* This equality is important for POSIX_SEMAPHORE_VALIDATE_OBJECT() */
rtems_test_assert( NULL == SEM_FAILED );
errno = 0;
More information about the vc
mailing list