[lsb-discuss] An issue with the headers

Wichmann, Mats D mats.d.wichmann at intel.com
Thu Jun 21 15:40:13 PDT 2007


lsb-discuss-bounces at lists.freestandards.org wrote:
> I've come across a problem with the LSB 3.0 headers, as described
> here: http://gcc.gnu.org/ml/gcc/2004-01/msg01360.html
> 
> I'd suggest the following patch to fix it, which is in line with the
> solution used by GCC: --- math.h.orig 2007-06-21 16:32:51.000000000
> -0600 +++ math.h      2007-06-21 13:51:53.000000000 -0600 @@ -11,7
> +11,13 @@ #define SING   2
> 
> 
> +/* We have a problem when using C++ since `exception' is a reserved
> + *    name in C++.  */ +# ifdef __cplusplus
> +    struct __exception {
> +# else
>     struct exception {
> +#endif
>        int type;
>        char *name;
>        double arg1;
> @@ -367,7 +373,11 @@
>     extern long int lround(double);
>     extern long int lroundf(float);
>     extern long int lroundl(long double);
> +# ifdef __cplusplus
> +    extern int matherr(struct __exception *);
> +#else
>     extern int matherr(struct exception *);
> +#endif
>     extern double nan(const char *);
>     extern float nanf(const char *);
>     extern long double nanl(const char *);

Yes, thanks, this is a known (but not solved) issue, see
http://bugs.linuxbase.org/show_bug.cgi?id=1403, you may 
want to add yourself to watch that bug.

The bug noodles a bit about how this has been a little
tricky to implement due to the way headers are generated
from database information, but we may recently have added
enough extra hooks that this is now possible without too
much hackery.

The bug also notes that matherr, the consumer of this
conflicting definition and a truly ancient creature that
predates widespread C++ support in libc headers, should
actually just be tossed on the scrap heap.




More information about the lsb-discuss mailing list