I've been following the thread about converting floats (or doubles)
to strings and have been struggling with the same problem for about
a week now.  In anticipation of the "go look in egroups" or similar
responses, I've looked around before asking, and have tried a few
different options.

I already know about the code fragment:

   FlpCompDouble num;
   char buf[80];

   num.d = some_float;
   FlpFToA( num.fd, buf );

I also know that the FlpFToA and FlpAToF functions have some problems.
However, wishing to use them anyway (they're good enough for now),
I am having some problems on which header file to use.  I'm using GCC
and mathlib (and everything else from mathlib is working correctly)!

   When using
   ----------
      float.h (from .../gcc/lib/gcc-lib/m68k-palmos-coff/2.7.2.2-kgpd-071097/include)

   I get
   -----
      In file included from calc.c:7:
      .../float.h:1: #error float.h values not known for cross-compiler

      Yes, it's because the #error line in the header file.  I already
      know that.

   When using
   ----------
      FloatMgr.h (from .../gcc/m68k-palmos-coff/include/PalmOS/System)

   I get
   -----
      test.c:33: `FlpCompDouble' undeclared (first use this function)
      test.c:33: (Each undeclared identifier is reported only once
      test.c:33: for each function it appears in.)
      test.c:33: parse error before `num'

      Because "floatmgr.h" doesn't define the structure.  So finally...

   When using
   ----------
      NewFloatMgr.h (from the same directory)

   I get
   -----
      .../NewFloatMgr.h: In function `_fp_round':
      In file included from test.c:7:
      .../NewFloatMgr.h:379: parameter name omitted
      .../NewFloatMgr.h: In function `_fp_set_fpscr':
      .../NewFloatMgr.h:387: parameter name omitted
      .../NewFloatMgr.h: In function `_f_utof':
      .../NewFloatMgr.h:402: parameter name omitted

   and so on for many lines.  It looks like it should be a *warning*
not an error, but the return code from the compiler is 2, not zero.
I've looked inside the header file to see if there was a section ifdef'ed
with names versus one without, but didn't see anything like that.

Is there a compiler option to enforce name use or some other adherance?
Or, is there something else that I'm missing?  I've trudged through
the raw "man" page for gcc, even though I don't have a (something)-roff
formatting program, and didn't notice any relevant information...

Thanks in advance for your help...

Dave.

-- 
Dave Smith
Colorado Springs, CO USA

Reply via email to