This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Support for long long type for C99 and C++11 compliant compilers
- From: Thomas Uhle <thomas dot uhle at eas dot iis dot fraunhofer dot de>
- To: <newlib at sourceware dot org>
- Date: Thu, 9 Oct 2014 16:20:39 +0200
- Subject: Re: Support for long long type for C99 and C++11 compliant compilers
- Authentication-results: sourceware.org; auth=none
- References: <1410285946 dot 1215 dot 540 dot camel at raymund7> <20141009123411 dot GB15717 at calimero dot vinschen dot de>
On Thu, 2014-10-09 at 14:34 +0200, Corinna Vinschen wrote:
> Hi Thomas,
>
> On Sep 9 20:05, Thomas Uhle wrote:
> > Hello,
> >
> > the attached patch fixes some issues with long long type support for
> > compilers that have C99 or C++11 compliance. For instance, llabs(),
> > lldiv() and atoll() have been missing if g++ was invoked with option
> > '-std=c++11'.
>
> Your patch is missing a ChangeLog entry. Also, why do you replace "long
> long" with _LONG_LONG_TYPE? Isn't _LONG_LONG_TYPE always "long long"?
> Also, while you're doing this in math.h, you're sticking to "long long"
> for other declarations like for atoll.
>
> What's the reasoning here?
Hi Corinna,
thanks for your reply! The macro _LONG_LONG_TYPE has been used rather
inconsistently through math.h, for llroundl() it is _LONG_LONG_TYPE, for
llroundf() it is "long long" for instance. I just tried to get its usage
aligned for all of these functions. As far as I can see, _LONG_LONG_TYPE
is only used in math.h, nowhere else. That is why I did not touch
anything else. And _LONG_LONG_TYPE is defined in _ansi.h to be "long
long" if _HAVE_STDC is defined and to be just "long" if _HAVE_STDC is
not defined. I do not know the rationale, but it seems that it has been
there since the time of the following entry in the ChangeLog:
| 2007-12-19 Dave Korn <dave.korn@artimi.com>
| Jeff Johnston <jjohnstn@redhhat.com>
|
| * libc/include/_ansi.h: Add _LONG_LONG definition.
| * libc/include/math.h (llrint, llrintf, rintl, lrintl, llrintl): Add
| prototypes.
I could perfectly live without _LONG_LONG_TYPE, though. But I do not
know whether replacing _LONG_LONG_TYPE by "long long" does break things
on any other platform. That is why ...
Surely I can send an update of the patch that is also adding an entry to
the ChangeLog once you have decided how to get along with
_LONG_LONG_TYPE. So just let me know ...
Best regards,
Thomas
--
Thomas Uhle
System Specification Mixed-Signal Systems
Fraunhofer Institute for Integrated Circuits IIS
Design Automation Division EAS
Zeunerstr. 38, 01069 Dresden, Germany
phone: +49 (0) 351 4640-786
mailto:thomas.uhle@eas.iis.fraunhofer.de
http://www.eas.iis.fraunhofer.de/