bug-autoconf
[Top][All Lists]
Advanced

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

Re: Problem with Sun Studio 12 C++


From: Eric Blake
Subject: Re: Problem with Sun Studio 12 C++
Date: Sun, 08 Mar 2009 08:48:40 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 3/8/2009 4:21 AM:
> Hello Eric, Rolf,

Hi Ralf,

> 
> I'm a bit late to the show:

That's okay, your contributions are still appreciated.

> I think the Autoconf testsuite deserves to detect this issue,
> lest it happen again.  How about this patch?

I like it.  Fix the nits, then apply.

> 
> The cpp-works stuff is necessary for systems without a working C++
> compiler.  AC_PROG_CXX sets CXX to g++ in that case.  We should find
> out why that was done, and fix it.

Didn't libtool already have to hack around that fact?  Yes, it would be
nice to make autoconf more honest when CXX cannot be found, but as a
separate patch.

> +
> +## ------------------------------------ ##
> +## AC_C_RESTRICT and the C++ compiler.  ##
> +## ------------------------------------ ##
> +
> +AT_SETUP([AC_C_RESTRICT and the C++ compiler])

That's a bit long for a title.  How about the shorter "AC_C_RESTRICT and C++".

> +AT_DATA([foo.c],
> +[[#include <config.h>
> +
> +int foo (int * restrict ip)
> +{
> +  return ip[0];
> +}

If I understand restrict correctly (although I'm not entirely sure I do),
it does not make sense to use restrict unless there are at least two
pointers in play, because you can't have aliasing without multiple
references.  While I don't think the language forbids a single parameter
with restrict, I also think that it may be better to write this as:

int foo (int * restrict i1, int * restrict i2)
{
  return i1[0] + i2[0];
}

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmz2scACgkQ84KuGfSFAYAFyACfUDQpv9EjtmYqK1ZnlzOFtimt
pxsAn1VTJ/zcWEwLUDju+g0E4Tugfbnr
=J7zM
-----END PGP SIGNATURE-----




reply via email to

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