26_numerics/c99_classification_macros_c++.cc fails on cygwin

Billinghurst, David (CRTS) David.Billinghurst@riotinto.com
Fri Jul 4 14:59:00 GMT 2003


Test 26_numerics/c99_classification_macros_c++.cc fails on cygwin. 
I have reduced the problem, but don't understand what's happening.

The reduced test case is

#include <cmath>
void fpclassify() { }

which fails with 

bug.cc:2: error: expected unqualified-id
bug.cc:2: error: expected `)'
bug.cc:2: error: expected `,' or `;'
bug.cc:2: error: expected unqualified-id
bug.cc:2: error: expected `,' or `;'

###########################################

This can be further reduced to

/* From /usr/include/float.h */
extern int __fpclassifyf (float x);
extern int __fpclassifyd (double x);
#define fpclassify(x) (__extension__ ({__typeof__(x) __x = (x); \
(sizeof (__x) == sizeof (float)) ? __fpclassifyf(__x) : __fpclassifyd(__x);}))

void fpclassify() { }

#############################################
The preprocessed source becomes

void (__extension__ ({__typeof__() __x = (); (sizeof (__x) == sizeof (float)) ? __fpclassifyf(__x) : __fpclassifyd(__x);})) { }



More information about the Libstdc++ mailing list