commit | bf74815b5281406a2cb8a87f652ac81c9e4a0899 | [log] [tgz] |
---|---|---|
author | Elliott Hughes <enh@google.com> | Tue Jul 17 13:55:36 2018 -0700 |
committer | Elliott Hughes <enh@google.com> | Tue Jul 17 13:55:36 2018 -0700 |
tree | 188e0d8e6e6cdd8b9aebb63b0bc77bd9a3e3c8ff | |
parent | a7119af33ef71ae24d809b5ea52c1ba913f97a6c [diff] [blame] |
setjmp is a macro. POSIX says it's unspecified whether setjmp is a macro or a function, but C11 says it's a macro, and the C standard always wins. Bug: https://github.com/android-ndk/ndk/issues/744 Test: ran tests Change-Id: I4a1abc37724f8e9d9498f2093ef3c1f3b8253949
diff --git a/tests/headers/posix/setjmp_h.c b/tests/headers/posix/setjmp_h.c index b6b75ee..6544d2a 100644 --- a/tests/headers/posix/setjmp_h.c +++ b/tests/headers/posix/setjmp_h.c
@@ -30,6 +30,12 @@ #include "header_checks.h" +// POSIX says it's undefined whether `setjmp` is a macro or a function, +// but C11 says it's a macro, and the C standard always wins. +#if !defined(setjmp) +#error setjmp +#endif + static void setjmp_h() { TYPE(jmp_buf); TYPE(sigjmp_buf);