[patch] fix template template declarations [GCC 4.2 compilation fix]
Hello! The attached patch corrects template template declarations, so GiNaC can be compiled with G++ 4.2. Without this patch compilation fails, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=362220 for details. Note that `make check' still fails with G++ 4.2. Basically, ex e("-1 + 2*I", symbol()); triggers an exception. My patch *does not* fix this error. Best regards, Alexei. -- All science is either physics or stamp collecting.
Alexei, Sheplyakov Alexei wrote:
The attached patch corrects template template declarations, so GiNaC can be compiled with G++ 4.2. Without this patch compilation fails, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=362220 for details.
An equivalent patch has been discussed recently at ginac-devel [0]. Maybe you wish to subscribe to that list? Best wishes -richy. [0] <http://www.ginac.de/pipermail/ginac-devel/2006-April/000932.html> and following. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
Sheplyakov Alexei wrote:
Note that `make check' still fails with G++ 4.2. Basically,
ex e("-1 + 2*I", symbol());
triggers an exception. My patch *does not* fix this error.
This happens in check/exam_numeric.cpp (exam_numeric6), right? It appears like it goes away by hard-coding some similar computation right before the construction of base and exponent in the inner loop. Heisenbugs of this sort hint at a compiler problems, in my opinion. For the record, I'm using GCC 4.2.0 20060506 (experimental). Regards -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
On Tue, May 09, 2006 at 10:57:22PM +0200, Richard B. Kreckel wrote:
Note that `make check' still fails with G++ 4.2. Basically,
ex e("-1 + 2*I", symbol());
triggers an exception. My patch *does not* fix this error.
This happens in check/exam_numeric.cpp (exam_numeric6), right?
Yes. There also the same error in check/exam_inifcns_nstdsums.cpp:inifcns_test_S(). Here is the simplest code which fails in the similar way (exception due to the parser error): #include <iostream> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main(int argc, char** argv) { ex e = ex("-1 + 2*I", symbol()); cout << e << endl; return 0; } The error message is: Terminate called after throwing an instance of 'std::runtime_error' what(): syntax error, unexpected T_EOF, expecting ']' or ',' at
It appears like it goes away by hard-coding some similar computation right before the construction of base and exponent in the inner loop. Heisenbugs of this sort hint at a compiler problems, in my opinion.
I'm not sure if we are talking about the same bug...
For the record, I'm using GCC 4.2.0 20060506 (experimental).
$ dpkg -l gcc-snapshot | tail -n 1 ii gcc-snapshot 20060508-1 A SNAPSHOT of the GNU Compiler Collection Best regards, Alexei. -- All science is either physics or stamp collecting.
Sheplyakov Alexei wrote:
Yes. There also the same error in check/exam_inifcns_nstdsums.cpp:inifcns_test_S().
That test passes here.
Here is the simplest code which fails in the similar way (exception due to the parser error):
#include <iostream> #include <ginac/ginac.h> using namespace std; using namespace GiNaC;
int main(int argc, char** argv) { ex e = ex("-1 + 2*I", symbol()); cout << e << endl; return 0; }
The error message is: Terminate called after throwing an instance of 'std::runtime_error' what(): syntax error, unexpected T_EOF, expecting ']' or ',' at
I tried this, too, based on your earlier email. But it works for me. Does shared/static lib and optimization flags make a difference for you? cheers -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
participants (2)
-
Richard B. Kreckel
-
varg@theor.jinr.ru