c++ patch

Marc Glisse marc.glisse at normalesup.org
Sun May 21 15:10:57 CEST 2006


On Tue, 16 May 2006, Torbjorn Granlund wrote:

>  I attach a patch that I am using. It in particular helps me on
>  solaris, where I use:
>
>  CC=cc
>  CXX=CC
>  ABI=32
>  CXXFLAGS=-library=stlport4
>
> Thanks.  (Are there problems with ABI=64, or you just trying to limit
> the blinding speed of sparc?)

Most of the libraries are available with the 32 bits ABI by default, and I 
am using gmp together with other libraries, so they have to use the same 
ABI, and I did not want to recompile the others. By the way, I thought 
having a 32 bits ABI did not prevent from using 64 bit types internally 
and did not slow down the computations much, but I may have misunderstood 
the way things work. (and I know you are not a huge fan of sparc...)

How did you guess it was sparc? It might as well have been a random PC 
running solaris-x86, and on amd64 there is the same dual ABI as on sparc.

>  Some cxx tests (t-binary t-ops t-prec t-ternary t-unary) still
>  fail to compile, but I believe it is because of bugs in the
>  compiler (whereas what I patched looks like bugs in the code).
> Is it determinable whether the compilation failures are bugs in the
> compiler or bugs in the code, in this advanced language?
> When I have tried to compile smoe C++ code with GCC, each syntax error
> gives about 300 MB worth of error messages.  Of course, such error
> messages can take some time to decipher.  :-)

After a long time of using it, you get used to some errors. I had already 
met all the error messages I met with gmpxx on pieces of code in an other 
library, so I just guessed the reasons were similar. To be certain, one 
would have to post on a c++ newsgroup like comp.lang.c++.moderated where 
people can quote from the standard as well as others can quote from the 
bible.

>  there are a number of missing std:: for c++ use. Since gmp-impl.h
>  is not installed, it can just use the easy "using namespace
>  std;". For gmp.h, I did something cleaner (It is better for
>  standard conformance, but I am not sure it may not hurt some
>  broken c++ compiler).

I am not saying this is the only way, or even the best, just one 
possibility. Some might prefer to put everything in a namespace gmp (but 
it would break compatibility), which would make using "using std::va_list" 
and others less of an issue. Others would say to use the *.h headers 
instead of the c* headers... I don't think there is anything widely 
accepted for C++-aware C headers.

>  I will check again after the next patch to sun's c++ compiler
>  (the one released today was a disappointment).
> When is the next patch going to be available?

I don't know, likely around september.

-- 
Marc Glisse


More information about the gmp-bugs mailing list