There are macros in float.h, which shouldn't be there, according to the standard and may break standard-compliant code by namespace pollution:
#define EXCESS 126
#define SIGNBIT ((unsigned long)0x80000000)
#define HIDDEN (unsigned long)(1ul << 23)
#define SIGN(fp) (((unsigned long)(fp) >> (8*sizeof(fp)-1)) & 1)
#define EXP(fp) (((unsigned long)(fp) >> 23) & (unsigned int) 0x00FF)
#define MANT(fp) (((fp) & (unsigned long)0x007FFFFF) | HIDDEN)
#define NORM 0xff000000
#define PACK(s,e,m) ((s) | ((unsigned long)(e) << 23) | (m))
Philipp
I saw many library files in sdcc/device/ used these macros. How about embrace them with a " # ifndef __SDCC_FLOAT_EXT__ / # endif " ?
Then we define __SDCC_FLOAT_EXT__ in the library files, and the above macros do not pollute the namespace in other source files.
Last edit: Maarten Brock 2015-06-29
Fixed in reversion [r9263].
Last edit: Maarten Brock 2015-06-30
Ben, did you forget to commit the library files that should now have this new macro defined before the include of float.h?
No. Maarten,
If I forgot, there could be many compling errors leading to failures of daily snapshot builds.
Actually, in previous version of each library file using these extended macros, the conditional macro is already defined before incluing float.h.
Ben
I replied because I was expecting failing snapshots.
But you're right. Everything was already there.
Thanks