disabling C++ labeled initializers broke i386-linux's HUGE_VAL

Mark Mitchell mmitchell@usa.net
Wed Feb 18 19:18:00 GMT 1998


>>>>> "Jeffrey" == Jeffrey A Law <law@hurl.cygnus.com> writes:

    Jeffrey>   In message
    Jeffrey> < 199802160112.BAA25292@quickstep.stanford.edu >you write:
    >> Therefore, I suggest that we do this:
    >> 
    >> o Ask the GLIBC maintainers to remove the labeled initializers
    >> in GLIBC.
    Jeffrey> Well, it's already too late to do any good for all the
    Jeffrey> systems out there that already have glibc installed,
    Jeffrey> including major Linux distributions like Red Hat, Debian,
    Jeffrey> SuSE, etc.

We could still ask them, so that this goes away in future releases.

    >> o Use fixincludes to fix the affected headers in the meanwhile.
    Jeffrey> What exactly needs to be changed (I haven't followed this
    Jeffrey> thread closely).  Ie, a before/after example would help
    Jeffrey> me judge whether or not it's something fixincludes can
    Jeffrey> do.

  The code in the header looks like:

  #define	   __HUGE_VAL_bytes    { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }

  #ifdef	 __GNUC__
  #define	 HUGE_VAL	(__extension__ \
					  ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d)
  #else		  /* Not GCC.  */
  static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
  #define		    HUGE_VAL   (__huge_val.__d)
  #endif		    /* GCC.  */

We'd like to fall into the /* Not GCC */ case, at least #if
__cplusplus, if we don't undo my change.

-- 
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu




More information about the Gcc-bugs mailing list