testsuite: Define _POSIX_SOURCE for tests [PR113278]
As the tests assume that fileno() is visible (only part of POSIX),
define the guard to ensure that it's visible. Currently, glibc appears
to always have this defined in C++, newlib does not.
Without this patch, fails like this can be seen:
Testing analyzer/fileno-1.c, -std=c++98
.../fileno-1.c: In function 'int test_pass_through(FILE*)':
.../fileno-1.c:5:10: error: 'fileno' was not declared in this scope
FAIL: c-c++-common/analyzer/fileno-1.c -std=c++98 (test for excess errors)
Patch has been verified on Linux.
gcc/testsuite/ChangeLog:
PR testsuite/113278
* c-c++-common/analyzer/fileno-1.c: Define _POSIX_SOURCE.
* c-c++-common/analyzer/flex-with-call-summaries.c: Same.
* c-c++-common/analyzer/flex-without-call-summaries.c: Same.
Signed-off-by:
Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Showing
- gcc/testsuite/c-c++-common/analyzer/fileno-1.c 2 additions, 0 deletionsgcc/testsuite/c-c++-common/analyzer/fileno-1.c
- gcc/testsuite/c-c++-common/analyzer/flex-with-call-summaries.c 1 addition, 0 deletions...estsuite/c-c++-common/analyzer/flex-with-call-summaries.c
- gcc/testsuite/c-c++-common/analyzer/flex-without-call-summaries.c 1 addition, 0 deletions...suite/c-c++-common/analyzer/flex-without-call-summaries.c
Loading
Please register or sign in to comment