Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.sys.hp.hpux FAQ
Section - 6.2.5 Is there some kind of problem with using FLT_MIN in ANSI mode?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Houses ]


Top Document: comp.sys.hp.hpux FAQ
Previous Document: 6.2.4 Why do I get "_builtin_va_start" undefined when I build with gcc?
Next Document: 6.2.6 Why do I get the error "*Initialization*:1: missing token-sequence in `#assert'" when I compile with gcc?
See reader questions & answers on this topic! - Help others by sharing your knowledge
The C compiler dislikes this construct in ANSI mode:

x = FLT_MIN;    /* <---- warning here */

The problem is that the ANSI mode (_PROTOTYPES) version of
FLT_MIN/FLT_MAX in <float.h> end their constants with an F, which seems
to upset the compiler.

The workaround is to temporarily undef _PROTOTYPES around the <float.h>
inclusion:

  #ifdef _PROTOTYPES
  #undef _PROTOTYPES
  #include <float.h>
  #define _PROTOTYPES
  #else
  #include <float.h>
  #endif

User Contributions:

Comment about this article, ask questions, or add new information about this topic: