#12751: Sage fails to build with GCC-4.7.0
--------------------------------------------------------------+-------------
       Reporter:  mariah                                      |         Owner:  
GeorgSWeber
           Type:  defect                                      |        Status:  
new        
       Priority:  blocker                                     |     Milestone:  
sage-5.0   
      Component:  build                                       |    Resolution:  
           
       Keywords:  GCC 4.7.0 C++11 -fpermissive compiler bugs  |   Work issues:  
           
Report Upstream:  N/A                                         |     Reviewers:  
           
        Authors:                                              |     Merged in:  
           
   Dependencies:                                              |      Stopgaps:  
           
--------------------------------------------------------------+-------------

Comment (by leif):

 Replying to [comment:22 leif]:
 > Replying to [comment:21 leif]:
 > > I get a build error for the (old) eclib spkg on '''Solaris''' [SPARC,
 32-bit]:
 > > {{{
 > > ...
 > > arith.h:182:39: error: 'int div(long int, long int)' conflicts with
 previous using declaration 'std::ldiv_t std::div(long int, long int)'
 > > ...
 > > }}}
 > [...] I have no idea why this only fails on Solaris, as AFAIK
 >
 > {{{
 > #!C++
 > std::ldiv_t std::div(long int, long int)
 > }}}
 >
 > is pretty C++98.  Maybe on Solaris just some `using namespace std;` gets
 pulled in, which isn't present on other systems.

 Apparently Solaris' `/usr/include/stdlib.h` is the culprit:
 {{{
 #!c++
 /*
  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */

 /*      Copyright (c) 1988 AT&T */
 /*        All Rights Reserved   */

 /*      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T     */
 /*      The copyright notice above does not evidence any        */
 /*      actual or intended publication of such source code.     */

 #ifndef _STDLIB_H
 #define _STDLIB_H

 #pragma ident   "@(#)stdlib.h   1.51    04/06/30 SMI"   /* SVr4.0 1.22  */

 #include <iso/stdlib_iso.h>
 #include <iso/stdlib_c99.h>

 #if defined(__EXTENSIONS__) || defined(_XPG4)
 #include <sys/wait.h>
 #endif

 /*
  * Allow global visibility for symbols defined in
  * C++ "std" namespace in <iso/stdlib_iso.h>.
  */
 #if __cplusplus >= 199711L
 ...
 using std::div;
 ...
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12751#comment:23>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to