Simon Glover (via RT) wrote:

# New Ticket Created by Simon Glover # Please include the string: [perl #23006]
# in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=23006 >




 At the moment, if you build Parrot with long doubles on Linux/x86, then
 Configure defines FLOATVAL_FMT as:

#define FLOATVAL_FMT "%Lf"

 Unfortunately, Parrot_eprintf etc. don't understand this format - if you
 try to use it, you get the error message:

'L' is not a valid sprintf format

Is this a bug in Configure, or a bug in the printf routines (or neither)?

Configure is ok (man sprintf).
The attached patch seems to cure the problem. pdb is working then. But the patch isn't complete. I think, we should also have support for "%lld" and friends. PIO_eprintf can fallback to vfprintf(3), when no interpreter is supplied, which means that we should have compatible format chars for basic data types.
A src test for these data types would also be fine.




Simon
leo

--- parrot/debug.c      Wed Jul 16 06:13:43 2003
+++ parrot-leo/debug.c  Wed Jul 16 06:53:37 2003
@@ -1220,7 +1220,7 @@
         case PARROT_ARG_NC:
             /* Convert the float to a string */
             f = interpreter->code->const_table->constants[op[j]]->u.number;
-            Parrot_snprintf(interpreter, buf, sizeof(buf), "%f", (double)f);
+            Parrot_snprintf(interpreter, buf, sizeof(buf), FLOATVAL_FMT, f);
             strcpy(&dest[size], buf);
             size += strlen(buf);
             break;
--- parrot/spf_render.c Wed Jul 16 06:13:43 2003
+++ parrot-leo/spf_render.c     Wed Jul 16 06:54:53 2003
@@ -454,6 +454,7 @@
                             info.type = SIZE_LONG;
                             continue;
 
+                        case 'L':
                         case 'H':
                             info.type = SIZE_HUGE;
                             continue;

Reply via email to