#11168: rubiks fails doctest with gcc 4.6.0 and -O2 optimisation.
---------------------------------------------------------------+------------
    Reporter:  drkirkby                                        |         Owner: 
 drkirkby     
        Type:  defect                                          |        Status: 
 needs_review 
    Priority:  major                                           |     Milestone: 
 sage-4.7     
   Component:  solaris                                         |    Resolution: 
              
    Keywords:                                                  |   Work_issues: 
              
    Upstream:  Reported upstream. Developers acknowledge bug.  |      Reviewer: 
 John Palmieri
      Author:  David Kirkby, Jeroen Demeyer                    |        Merged: 
              
Dependencies:                                                  |  
---------------------------------------------------------------+------------

Comment(by drkirkby):

 Replying to [comment:24 jdemeyer]:
 > Replying to [comment:22 drkirkby]:
 > >  * My test does not use the -dumpversion option unless the compiler is
 first confirmed to be gcc, since the second part of the test (the version)
 will not be executed unless the first part (the type of compiler), is
 confirmed to be GCC. So I don't really see the need to send stderr to
 /dev/null, but I'm not bothered about that fact.
 >
 > Can you guarantee that every compiler which defines {{{__GNUC__}}}
 understands the option {{{-dumpversion}}}?

 I think if any compiler is going to aim to be GCC compatible then it would
 need to support the '{{{-dumpversion}}}' option. If it does not, then I
 would consider that a compiler bug. The Intel compiler supports
 '{{{-dumpversion}}}' - see

 http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-
 us/cpp/lin/main_cls_lin.pdf

 Clang does too:

 https://llvm.org/viewvc/llvm-
 
project/cfe/trunk/include/clang/Driver/Options.td?sortby=date&r1=106956&r2=106955&pathrev=106956&diff_format=s

 ''GCC For Sun Systems'' uses the gcc front end and takes the GNU options.
 It actually uses the GCC source code, so I assume that would take the
 '{{{-dumpversion}}}' option too.

 I'm not aware of any other GCC compatible compiler. But if they really are
 GCC compatible, they should take the '{{{-dumpversion}}}' option.

 I've just checked gcc 3.4.3, and that takes the '{{{-dumpversion}}}'
 option.

 {{{
 drkirkby@hawk:~$ /usr/bin/gcc -dumpversion
 3.4.3
 drkirkby@hawk:~$ /usr/bin/g++ -dumpversion
 3.4.3
 drkirkby@hawk:~$
 }}}

 Just out of interest, I checked on t2.math (a SPARC system), and that
 supports {{{-dumpversion}}}' too.

 {{{
 kirkby@t2:32 ~$ /usr/sfw/bin/gcc -dumpversion
 3.4.3
 }}}

 I would use more caution if it was the Fortran compiler we were testing,
 as the option gave a different output (same as --version) in older
 versions of gfortran. But that bug was fixed a year or two ago, so that
 now '{{{gfortran}}}' gives just the version number if given the option
 '{{{-dumpversion}}}'. But that test in the rubiks package only tests the C
 compiler, so it's immaterial what {{{gfortran}}} does.

 I would also note we are using the {{{-dumpversion}}}' compiler option
 already. The 'prereq' script uses two autoconf macros
 ({{{ax_gcc_version.m4}}} & {{{ax_gxx_version.m4}}}) which use the option.
 That is run to check the versions of gcc and g++ are the same. So I think
 if there was a problem using the {{{-dumpversion}}}' compiler option, we
 would have known about it before.

 Dave

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11168#comment:25>
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