[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bogus gl_C_COMPOUND_LITERALS test
From: |
Jim Meyering |
Subject: |
Re: Bogus gl_C_COMPOUND_LITERALS test |
Date: |
Tue, 24 Jun 2008 15:28:10 +0200 |
Andreas Schwab <address@hidden> wrote:
> The gl_C_COMPOUND_LITERALS test can never succeed, since the test
> program is invalid C. A compound literal is never a constant
> expression, thus cannot be used to initialize a static variable.
Hi Andreas,
Thanks for the patch. It looks fine.
However, note that the test does succeed with gcc and -std=c89
or -std=gnu89, so we'll have to adjust the ChangeLog entry.
> 2008-06-24 Andreas Schwab <address@hidden>
>
> * m4/getdate.m4 (gl_C_COMPOUND_LITERALS): Remove invalid
> initializer that causes the test to always fail.
>
> diff --git a/m4/getdate.m4 b/m4/getdate.m4
> index d160329..20382ec 100644
> --- a/m4/getdate.m4
> +++ b/m4/getdate.m4
> @@ -7,7 +7,7 @@
> AC_DEFUN([gl_C_COMPOUND_LITERALS],
> [
> AC_CACHE_CHECK([for compound literals], gl_cv_compound_literals,
> - [AC_TRY_COMPILE([struct s { int i, j; }; struct s s = (struct s) { 1, 2
> };],
> + [AC_TRY_COMPILE([struct s { int i, j; };],
> [struct s t = (struct s) { 3, 4 };
> if (t.i != 0) return 0;],
> gl_cv_compound_literals=yes,