bug-autoconf
[Top][All Lists]
Advanced

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

Re: test for restrict fails with MS compiler


From: Noah Misch
Subject: Re: test for restrict fails with MS compiler
Date: Wed, 18 Jul 2007 09:36:00 -0700
User-agent: Mutt/1.5.9i

On Wed, Jul 18, 2007 at 02:31:50PM +0200, Jerker B?ck wrote:
> Hello Ralf,

> > Is there a misunderstanding here?  Autoconf supports MSVC wrt. restrict:
> > it will add
> >  #define restrict
> > to config.h which will cause code like in the configure test to be 
> > compiled successfully by MSVC, no?
> 
> Kind of "better safe then sorry" approach. I wonder, what is the impact of
> ignoring the restrict keyword?

Exactly.  `restrict' is never required for correctness; it specifies constraints
that a compiler can use to perform better optimizations.

> I see, you are probably right in a technical sense. However, it doesn't help
> at all. Why not lighten the strict requirement for C99 for better
> portability?

It may not help _you_, because your program only uses `restrict' in ways that
the MS compiler handles correctly.  `AC_C_RESTRICT' serves a general audience,
seeking to make programs work at the expense of optimization.  You could use the
implementation of `AC_C_RESTRICT' as a starting point for your own macro that
only tests the subset of valid `restrict' usage that interests you.

As Ralf said, `AC_C_RESTRICT' supports your compiler precisely as intended: it
defines away the `restrict' keyword, which your compiler implements incorrectly.




reply via email to

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