]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: refine gcc.dg/analyzer/fd-4.c test for newlib
authorMarc Poulhiès <poulhies@adacore.com>
Mon, 6 Nov 2023 11:01:17 +0000 (12:01 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 7 Dec 2023 13:29:59 +0000 (14:29 +0100)
Contrary to glibc, including stdio.h from newlib defines mode_t which
conflicts with the test's type definition.

.../gcc/testsuite/gcc.dg/analyzer/fd-4.c:19:3: error: redefinition of typedef 'mode_t' with different type
...
.../include/sys/types.h:189:25: note: previous declaration of 'mode_t' with type 'mode_t' {aka 'unsigned int'}

Defining _MODE_T_DECLARED skips the type definition.

gcc/testsuite/ChangeLog:

* gcc.dg/analyzer/fd-4.c: Fix for newlib.

gcc/testsuite/gcc.dg/analyzer/fd-4.c

index 3a961e4f8137e24cf7c67f5c0b57039b7716aeb2..880de3d78960745e78c9c7bc15edca0a1c531632 100644 (file)
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-D_MODE_T_DECLARED=1" { target newlib } } */
 #if defined(_AIX) || defined(__hpux)
 #define _MODE_T
 #endif