autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c99


From: Paul Eggert
Subject: Re: c99
Date: Sat, 13 Oct 2001 11:24:57 -0700 (PDT)

> From: address@hidden
> Date: Sat, 13 Oct 2001 10:22:31 -0700
> 
> AC_MSG_CHECKING([whether $CC accepts C99 declarations])
> AC_TRY_COMPILE([],[
>   int x=0; x+=1; int y=0;
>   for (int z=0; z < 2; z++);
> ],[
>   AC_MSG_RESULT(yes)
> ],
> [
>   AC_MSG_ERROR([
> *** This package requires a C99 compiler.])
> ])

OK, but why bother with that?  Just run 'make'.  If it fails, your
compiler doesn't support C99 declarations.  I see little need to
discover that at 'configure'-time.

In other words, Autoconf's goal is to make packages more portable.  If
your package is deliberately unportable to older compilers, you don't
need Autoconf to support that.

Now, if your goal was to find a C compiler tht supported C99
declarations, that would be another story.

Or if your goal was to define a macro that is nonzero if C99
declarations are supported, Autoconf could do that too.  But I don't
think a macro like that would be all that useful in practice: it'd
just make the code uglier.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]