Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!apple!fernwood!uupsi!cmcl2!adm!lhc!nih-csl!alw.nih.gov!kgorlen From: kgorlen@alw.nih.gov (Keith Gorlen) Newsgroups: comp.lang.c++ Subject: Re: form() is broken Message-ID: <1472@nih-csl.nih.gov> Date: 11 May 91 01:10:35 GMT References: <1991May10.200911.28671@jpl-devvax.jpl.nasa.gov> Sender: news@nih-csl.nih.gov Reply-To: kgorlen@alw.nih.gov (Keith Gorlen) Organization: National Inst. of Health Lines: 27 In article <1991May10.200911.28671@jpl-devvax.jpl.nasa.gov>, russb@alexa.JPL.NASA.GOV (Russ Brill) writes: |> >The form function in C++, i.e.: |> > |> > cout << form(,) ; |> > |> >seems to be broken. Let p be a pointer to a vector of floats. |> > |> > cout << p[1]; // this works |> > |> > cout << form("%f",p[1]) ; // IOT Trap (Core dumped) |> > |> |> We've also had problems with form(). Specifically, something like |> |> form("%-20.10s","abc") |> |> compiles just fine, but it generates 20 blanks. This is on Sun's |> cfront 2.0 on a Sparc (works just fine on our Sun 3's). Try compiling the iostream libraries with -DVSPRINTF=vsprintf. form() uses non-portable code that doesn't work on a SPARC otherwise. -- Keith Gorlen phone: (301) 496-1111 Building 12A, Room 2033 FAX: (301) 402-0007 National Institutes of Health uucp: uunet!kgorlen%alw.nih.gov Bethesda, MD 20892 Internet: kgorlen@alw.nih.gov