bug-autoconf
[Top][All Lists]
Advanced

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

Re: AC_C_RESTRICT


From: Jeff Squyres
Subject: Re: AC_C_RESTRICT
Date: Tue, 17 Mar 2009 21:02:40 -0400

Excellent -- with the information from this thread, we tracked down the issue to the fact that the reporter was using Autoconf 2.61. AC 2.61 checks "restrict" first (instead of checking "__restrict") first.

[Immediate] Problem solved!

That being said, for cases like the Solaris compiler, it might still be nice to have a complete solution AC_RESTRICT macros that checks both the C and C++ compilers and has proper definitions for each in the resulting config.h file.

Just my $0.02...


On Mar 17, 2009, at 3:33 PM, Ralf Wildenhues wrote:

* Eric Blake wrote on Tue, Mar 17, 2009 at 03:34:35PM CET:
>
> Ralf brought up an interesting point - how often do people mix C and C++
> compilers of different origins, and expect things to work?  In other
> words, it seems to me that the most common use case is that you either > stick with the vendor compiler in all cases (hence the workaround for the
> Sun compiler),

If that were the only use case, then the Sun issue (the one reported a
couple of weeks ago, not the one for older Sun suite versions) could
have been fixed in a simpler way: by trying _Restrict first.

> or you use gcc in all cases.  But if we're mistaken, and
> people really DO want to mix vendor C and g++ (or vendor C++ and gcc), > then we must either entirely avoid restrict in C++, or else we must indeed
> make AC_C_RESTRICT perform additional testing inside an
> AC_LANG_PUSH([C++])/AC_LANG_POP block, if the configure script does
> anything for C++.

FWIW, this issue comes up more generally at times. For example, several bits in Libtool implicitly assume the compilers are from the same suite,
or at least roughly similar in that they use the same linker under the
hood.  Lifting all such restrictions while still allowing to create
mixed language code is pretty difficult in general (but would be nice to
have!).

Cheers,
Ralf





--
Jeff Squyres
Cisco Systems





reply via email to

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