[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] Including chicken.h fails for C++11
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] Including chicken.h fails for C++11 |
Date: |
Sun, 14 Jun 2015 17:46:48 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Jan 14, 2015 at 04:17:00PM +0300, Izaak wrote:
> Hi,
>
> I realize that Chicken is a C library, but when using it in C++11, I get a
> compilation error because of mismatched math function declarations, for
> example:
> /usr/local/include/chicken/chicken.h:1036:27: error: declaration of
> ‘double trunc(double)’ has a different exception specifier
> extern double trunc(double);
>
> That was from gcc 4.9.1. I have attached full error output.
I had a look at this, and I'm puzzled by the following bit:
# ifdef __linux__
extern double round(double);
extern double trunc(double);
# endif
We already include math.h, which should include the definition already,
so I don't see the point in declaring it ourselves. Felix: do you
remember why this was added? The original version was slightly different:
# ifdef __GNUC__
/* this is stupid */
extern double round(double);
extern double trunc(double);
# endif
It was introduced in changeset fcc7e346c63e24be91337df9a3ad30d0c5360144
in December 2009.
Cheers,
Peter
signature.asc
Description: Digital signature
- Re: [Chicken-hackers] Including chicken.h fails for C++11,
Peter Bex <=