public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Pyhalov <alp@rsu.ru>
To: gcc@gcc.gnu.org
Subject: g++ 4.7 illumos regressions
Date: Mon, 03 Jun 2013 09:12:00 -0000	[thread overview]
Message-ID: <51AC5DF3.2080800@rsu.ru> (raw)

Hello.
While building different c++ projects with gcc 4.7 on OpenIndiana I've 
faced several problems with Solaris standard headers (including 
stdlib.h, iso/stdlib_iso.h, iso/stdio_iso.h and other)

https://www.illumos.org/issues/3787

The prolem was introduced by fixing 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773 (defining __cplusplus 
correctly). I've tested some patches to illumos headers, but even with 
patches applied not all g++ tests in gcc/testsuite can be passed).

Firstly, it seems that g++ searches for abs(double) in <stdlib.h>:


/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/bits/random.tcc:1269:39: 
error: call of overloaded 'abs(const double&)' is ambiguous

/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/bits/random.tcc:1269:39: 
note: candidates are:

In file included from /usr/include/stdlib.h:34:0,

                 from 
/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/cstdlib:66,

                 from 
/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/bits/stl_algo.h:61,

                 from 
/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/algorithm:63,

                 from ./g++.dg/cpp0x/lambda/lambda-pass.C:5:

/usr/include/iso/stdlib_iso.h:124:12: note: int abs(int)

In file included from 
/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/bits/stl_algo.h:61:0,

                 from 
/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/algorithm:63,

                 from ./g++.dg/cpp0x/lambda/lambda-pass.C:5:

/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/cstdlib:175:3: 
note: long long int __gnu_cxx::abs(long long int)


double abs(double) is defined in math.h, however above-mentioned headers 
don't include it.

Other errors in dejagnu logs include

In file included from ./g++.old-deja/g++.other/inline2.C:5:0:
/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/cmath:102:5: 
note: template<class _Tp> typename 
__gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type 
std::abs(_Tp)
/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/cmath:102:5: 
note:   template argument deduction/substitution failed:
/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/cmath: 
In substitution of 'template<class _Tp> typename 
__gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type 
std::abs(_Tp) [with _Tp = double]':
./g++.old-deja/g++.other/inline2.C:10:38:   required from here
/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/cmath:102:5: 
error: no type named '__type' in 'struct __gnu_cxx::__enable_if<false, 
double>'


/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/bits/stl_algo.h:5499:5: 
note: void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = 
__gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = 
std::pointer_to_binary_function<const E
xpr<int>, const Expr<int>, bool>]
/usr/gcc/4.7/lib/gcc/i386-pc-solaris2.11/4.7.3/../../../../include/c++/4.7.3/bits/stl_algo.h:5499:5: 
note:   no known conversion for argument 3 from '<unresolved overloaded 
function type>' to 'std::pointer_to_binary_function<const Expr<int>, 
const Expr<int>, bool>'

I don't know how these errors can be fixed. The GCC bug 1773 was closed, 
but g++ 4.7 is still broken in OpenIndiana/illumos environment. Need 
your advices. If you wish I can share dejagnu logs somewhere (with 
patched illumos headers and with original headers).
-- 
Best regards,
Alexander Pyhalov,
system administrator of Computer Center of Southern Federal University

             reply	other threads:[~2013-06-03  9:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03  9:12 Alexander Pyhalov [this message]
2013-06-03 14:59 ` Rainer Orth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51AC5DF3.2080800@rsu.ru \
    --to=alp@rsu.ru \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).