On Wed, Oct 09, 2002 at 11:28:32PM -0700, Brent Dax wrote:
> Once I clear up the issue with the Sun compiler, I'll be committing
> this.  Well, a slightly modified version.  Relax, it's nothing
> drastic--I just ran it through check_source_standards.pl and
> run_indent.pl.

That checkin broke the build on my machine. It said:

spf_vtable.c: In function `getchr_va':
spf_vtable.c:41: `char' is promoted to `int' when passed through `...'
spf_vtable.c:41: (so you should pass `int' not `char' to `va_arg')
spf_vtable.c: In function `getfloat_va':
spf_vtable.c:117: `float' is promoted to `double' when passed through `...'

I am on a rather vanilla x86 linux with gcc 2.96, so I decided it
would be better to fix this and potentially break other platforms
(though hopefully they'll be ok with this change too.) So I committed
this:

Index: spf_vtable.c
===================================================================
RCS file: /cvs/public/parrot/spf_vtable.c,v
retrieving revision 1.1
diff -p -u -r1.1 spf_vtable.c
--- spf_vtable.c        11 Oct 2002 01:46:31 -0000      1.1
+++ spf_vtable.c        11 Oct 2002 06:42:04 -0000
@@ -38,7 +38,7 @@ getchr_va(struct Parrot_Interp *interpre
 {
     va_list *arg = (va_list *) (obj->data);
 
-    char ch = va_arg(*arg, char);
+    char ch = (char) (int) va_arg(*arg, int);
     return string_make(interpreter, &ch, 1, NULL, 0, NULL);
 }
 
@@ -114,7 +114,7 @@ getfloat_va(struct Parrot_Interp *interp
 
     switch (size) {
     case SIZE_SHORT:
-        return (HUGEFLOATVAL) (float)va_arg(*arg, float);
+        return (HUGEFLOATVAL) (double)va_arg(*arg, double);
     case SIZE_REG:
         return (HUGEFLOATVAL) (double)va_arg(*arg, double);
     case SIZE_HUGE:

Reply via email to