From: MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 16-DEC-1992 00:18:16.05 To: info-vax@kl.sri.com CC: Subj: InterViews 3.1b3 doc: VAXCRTL doesn't like "%g" formatted input I had problems with my VMS port of the InterViews 3.1-beta3 doc editor which crashed either because of "divide by zero" or "floating overflow". I've found that the formatted input routines in VAXCRTL don't like "%g". They refuse to change the float's value and don't increment the return value (success counter). I think that it is not a real bug, because table 2-2 of the "VAX C Run-Time Library Reference Manual" (February 1991, VAX C 3.2 for VMS 5.2 or higher) doesn't list "%g" as allowed for input. But in fact, GCC relies on it, so it's not ANSI-C compatible. BTW: We use GCC 2.2.2 and VMS 5.5-1 . Suggested Workaround: Change all "%g" to "%e" in input formatting strings. I've done this in: (original UNIX names) src/bin/doc/document.c (2 lines) src/bin/doc/idrawimage.c (3 lines) The following shows what's going on: ========================================================================= #include main() { float f; int s; printf("%g\n", f); s = sscanf("10.0","%g",&f); printf("%g %d\n", f, s); s = sscanf("10.0","%e",&f); printf("%g %d\n", f, s); } ========================================================================= $ run main 2.350989e-38 2.350989e-38 0 10 1 ========================================================================= I'll post this to both comp.os.vms and comp.windows.interviews . Thanks, Heribert (dahms@ifk20.mach.uni-karlsruhe.de)