public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: refine gcc.dg/analyzer/fd-4.c test for newlib
@ 2023-11-06 11:01 Marc Poulhiès
  2023-12-01 16:22 ` Marc Poulhiès
  2023-12-01 17:21 ` Mike Stump
  0 siblings, 2 replies; 3+ messages in thread
From: Marc Poulhiès @ 2023-11-06 11:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: dmalcolm, Marc Poulhiès

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.
---
Tested on x86_64-linux and x86_64-elf.

Ok for master?

 gcc/testsuite/gcc.dg/analyzer/fd-4.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-4.c b/gcc/testsuite/gcc.dg/analyzer/fd-4.c
index 994bad84342..e4a834ade30 100644
--- a/gcc/testsuite/gcc.dg/analyzer/fd-4.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-4.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-D_MODE_T_DECLARED=1" { target newlib } } */
 #ifdef _AIX
 #define _MODE_T
 #endif
-- 
2.42.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] testsuite: refine gcc.dg/analyzer/fd-4.c test for newlib
  2023-11-06 11:01 [PATCH] testsuite: refine gcc.dg/analyzer/fd-4.c test for newlib Marc Poulhiès
@ 2023-12-01 16:22 ` Marc Poulhiès
  2023-12-01 17:21 ` Mike Stump
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Poulhiès @ 2023-12-01 16:22 UTC (permalink / raw)
  To: Marc Poulhiès; +Cc: gcc-patches, dmalcolm


Marc Poulhiès <poulhies@adacore.com> writes:

> 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.
> ---
> Tested on x86_64-linux and x86_64-elf.
>
> Ok for master?
>
>  gcc/testsuite/gcc.dg/analyzer/fd-4.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-4.c b/gcc/testsuite/gcc.dg/analyzer/fd-4.c
> index 994bad84342..e4a834ade30 100644
> --- a/gcc/testsuite/gcc.dg/analyzer/fd-4.c
> +++ b/gcc/testsuite/gcc.dg/analyzer/fd-4.c
> @@ -1,3 +1,4 @@
> +/* { dg-additional-options "-D_MODE_T_DECLARED=1" { target newlib } } */
>  #ifdef _AIX
>  #define _MODE_T
>  #endif

Ping ?

Thanks,
Marc

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] testsuite: refine gcc.dg/analyzer/fd-4.c test for newlib
  2023-11-06 11:01 [PATCH] testsuite: refine gcc.dg/analyzer/fd-4.c test for newlib Marc Poulhiès
  2023-12-01 16:22 ` Marc Poulhiès
@ 2023-12-01 17:21 ` Mike Stump
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Stump @ 2023-12-01 17:21 UTC (permalink / raw)
  To: Marc Poulhiès; +Cc: gcc-patches, dmalcolm

On Nov 6, 2023, at 3:01 AM, Marc Poulhiès <poulhies@adacore.com> wrote:
> 
> 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.
> ---
> Tested on x86_64-linux and x86_64-elf.
> 
> Ok for master?

Ok,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-01 17:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-06 11:01 [PATCH] testsuite: refine gcc.dg/analyzer/fd-4.c test for newlib Marc Poulhiès
2023-12-01 16:22 ` Marc Poulhiès
2023-12-01 17:21 ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).