From: YuGiOhJCJ Mailing-L. <yug...@la...> - 2012-12-12 17:09:18
|
On Tue, 11 Dec 2012 20:05:53 -0200 Cristiano Sumariva <sum...@gm...> wrote: > Yes but I did not realized that this macro is standard in library. Not > compiler specific. > I rechecked the second file float.h and find the appropriate macro is > defined there in a way as I suggested > #define FLT_MIN_EXP __FLT_MIN_EXP__ > > So this macro is part of standard library and should not be redefined by > hand as others pointed. > It is part of glibc( all other libc ISO? ). > > http://www.gnu.org/software/libc/manual/html_mono/libc.html#Floating-Point-Parameters > > Try compile this test program with your gcc tool > > #include <stdio.h> > #include <float.h> > > int main( int argc, char* argv[] ) > { > printf( "Test for macro FLT_MIN_EXP\n" ); > printf( "Value of macro FLT_MIN_EXP: %d\n", FLT_MIN_EXP ); > printf( "Exit OK" ); > } > > It should compile if system can find the header float.h. > What other are saying is that by some reason your include directories are > not been added to compile stage or been replaced by some command. > > 2012/12/11 YuGiOhJCJ Mailing-List <yug...@la...> > > > On Tue, 11 Dec 2012 17:41:40 -0200 > > Cristiano Sumariva <sum...@gm...> wrote: > > > > > Well I could never got a chance to advance to learn the autotools > > utilities. > > > It is expected to make tests on source code to make it compile on several > > > architetures(?). > > > > > > Maybe it is aliased on gcc with another name. > > > Try this to see if some gcc built int macro is closer to what you want: > > > > > > echo | gcc -E -dM - | grep FLT > > > I got this on my gcc > > > #define __FLT_MIN_EXP__ (-125) > > > > > > Yes you may be in need of a compiler check and if using gcc-mingw[32|64] > > > add a -D __FLT_MIN_EXP__=xxx flag. > > > > > > Or if you expect to use gcc as compiler add proper #ifdefs for it > > > #ifdef __GNUC__ > > > /* using a GNUC compiler so what it blessed utilites it provides to me ? > > */ > > > #define FLT_MIN_EXP __FLT_MIN_EXP__ > > > #endif > > > > > > see docs at > > http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html > > > > I got this: > > $ echo | gcc -E -dM - | grep FLT > > #define __FLT_MIN__ 1.17549435082228750797e-38F > > #define __FLT_EVAL_METHOD__ 2 > > #define __FLT_EPSILON__ 1.19209289550781250000e-7F > > #define __FLT_HAS_DENORM__ 1 > > #define __FLT_MIN_EXP__ (-125) > > #define __FLT_MANT_DIG__ 24 > > #define __FLT_RADIX__ 2 > > #define __FLT_HAS_QUIET_NAN__ 1 > > #define __FLT_MAX_10_EXP__ 38 > > #define __FLT_HAS_INFINITY__ 1 > > #define __FLT_DIG__ 6 > > #define __FLT_MAX_EXP__ 128 > > #define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F > > #define __FLT_MAX__ 3.40282346638528859812e+38F > > #define __FLT_MIN_10_EXP__ (-37) > > > > If I understand correctly you suggest to add the undefined FLT_MIN_EXP > > macro manually using the -D gcc option, or editing a header file ? > > > > I don't understand exactly the difference between gcc and gcc-mingw. > > I remember when I have built my cross compiler I compiled binutils, gcc, > > mingwrt, w32api, ... So gcc is my compiler. > > MinGW is just here to give the libraries and headers files, but the > > compiler is always GCC isn't it? > > > > I compiled and run your program and this is the output: $ ./a.out Test for macro FLT_MIN_EXP Value of macro FLT_MIN_EXP: -125 I compiled it with my native compiler (gcc). Now, with my cross-compiler (i686-pc-mingw32-gcc), I can't compile: $ i686-pc-mingw32-gcc main.c main.c: In function 'main': main.c:6:46: error: 'FLT_MIN_EXP' undeclared (first use in this function) main.c:6:46: note: each undeclared identifier is reported only once for each function it appears in The thing that I don't understand is why my native compiler (gcc) can compile it. Indeed, I haven't the float.h file in my /usr/include directory: $ find /usr/include -name "float.h" /usr/include/c++/4.5.2/tr1/float.h /usr/include/wine/msvcrt/float.h So why it doesn't complains that the float.h header isn't found? And where can it found the FLT_MIN_EXP macro? Regards. |