genmatch: Fix build on hppa64-hpux [PR117348]

Message ID ZyHiUuU8/oU5mhVa@tucnak
State New
Headers
Series genmatch: Fix build on hppa64-hpux [PR117348] |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_check--master-arm fail Patch failed to apply

Commit Message

Jakub Jelinek Oct. 30, 2024, 7:37 a.m. UTC
  Hi!

Apparently autoconf defines the HAVE_DECL_* macros to 0
rather than not defining them at all, so defined(HAVE_DECL_FMEMOPEN)
test doesn't do much.

The following patch fixes it by testing HAVE_DECL_FMEMOPEN
for being non-zero instead.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2024-10-30  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/117348
	* genmatch.cc: Replace defined(HAVE_DECL_FMEMOPEN)
	test with HAVE_DECL_FMEMOPEN.


	Jakub
  

Comments

Richard Biener Oct. 30, 2024, 8:43 a.m. UTC | #1
On Wed, 30 Oct 2024, Jakub Jelinek wrote:

> Hi!
> 
> Apparently autoconf defines the HAVE_DECL_* macros to 0
> rather than not defining them at all, so defined(HAVE_DECL_FMEMOPEN)
> test doesn't do much.
> 
> The following patch fixes it by testing HAVE_DECL_FMEMOPEN
> for being non-zero instead.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK.

> 2024-10-30  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR middle-end/117348
> 	* genmatch.cc: Replace defined(HAVE_DECL_FMEMOPEN)
> 	test with HAVE_DECL_FMEMOPEN.
> 
> --- gcc/genmatch.cc.jj	2024-10-27 16:44:30.792004967 +0100
> +++ gcc/genmatch.cc	2024-10-29 18:04:52.888907269 +0100
> @@ -585,7 +585,7 @@ diag_vfprintf (FILE *f, int err_no, cons
>    fprintf (f, "%s", q);
>  }
>  
> -#if defined(GENMATCH_SELFTESTS) && defined(HAVE_DECL_FMEMOPEN)
> +#if defined(GENMATCH_SELFTESTS) && HAVE_DECL_FMEMOPEN
>  #pragma GCC diagnostic push
>  #pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
>  
> 
> 	Jakub
> 
>
  

Patch

--- gcc/genmatch.cc.jj	2024-10-27 16:44:30.792004967 +0100
+++ gcc/genmatch.cc	2024-10-29 18:04:52.888907269 +0100
@@ -585,7 +585,7 @@  diag_vfprintf (FILE *f, int err_no, cons
   fprintf (f, "%s", q);
 }
 
-#if defined(GENMATCH_SELFTESTS) && defined(HAVE_DECL_FMEMOPEN)
+#if defined(GENMATCH_SELFTESTS) && HAVE_DECL_FMEMOPEN
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wsuggest-attribute=format"