| Bill Allombert on Thu, 6 Jan 2000 20:11:53 +0100 (MET) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: proposed g++ patch |
Hello,
for compiling with g++ I do not need the patch proposed by Igor
but the patch at the end of file instead, however I get the (non fatal) warning
g++ -c -O2 -DGCC_INLINE -mv8 -I. -I../src/headers -o init.o ../src/language/init.c
../src/language/init.c: In function `volatile void pari_err(long int ...)':
../src/language/init.c:888: warning: ANSI C++ forbids implicit conversion from `void *' in argument passing
when I compile without it.
I know nothing about C++ so I don't see what is really the trouble.
I use :
$g++ -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.8.1/specs
gcc version 2.8.1
g++ do not compile without the following patch:
Index: src/language/init.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/language/init.c,v
retrieving revision 1.19
diff -u -r1.19 init.c
--- src/language/init.c 2000/01/05 20:45:04 1.19
+++ src/language/init.c 2000/01/06 19:02:23
@@ -949,15 +949,17 @@
case operi: case operf:
{
- char *op = va_arg(ap, char*), *f;
+ char *op = va_arg(ap, char*);
+ int f;
+ char *opf[]={"addition","multiplication","division","gcd","assignment"};
long x = va_arg(ap, long);
long y = va_arg(ap, long);
- if (*op == '+') f = "addition";
- else if (*op == '*') f = "multiplication";
- else if (*op == '/' || *op == '%') f = "division";
- else if (*op == 'g') { op = ","; f = "gcd"; }
- else { op = "-->"; f = "assignment"; }
- pariputsf(" %s %s %s %s.",f,type_name(x),op,type_name(y));
+ if (*op == '+') f = 0;
+ else if (*op == '*') f = 1;
+ else if (*op == '/' || *op == '%') f = 2;
+ else if (*op == 'g') { op = ","; f = 3; }
+ else { op = "-->"; f = 4; }
+ pariputsf(" %s %s %s %s.",opf[f],type_name(x),op,type_name(y));
break;
}