[cfe-dev] Predefined stdint macros (i.e. __UINT8_TYPE__, etc.)

Richard Smith richard at metafoo.co.uk
Fri Jun 13 16:49:27 PDT 2014


On Fri, Jun 13, 2014 at 1:30 AM, Paul A. Bristow <pbristow at hetp.u-net.com>
wrote:

> *From:* cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] *On
> Behalf Of *Chandler Carruth
> *Sent:* 11 June 2014 20:15
> *To:* Ben Smith
> *Cc:* clang-dev Developers
> *Subject:* Re: [cfe-dev] Predefined stdint macros (i.e. __UINT8_TYPE__,
> etc.)
>
>
>
>
>
> On Wed, Jun 11, 2014 at 8:10 PM, Ben Smith <binji at chromium.org> wrote:
>
> Hello cfe-dev,
>
>
>
> Clang defines a subset of the predefined stdint macros that GCC does. In
> particular, GCC defines the following macros many of which are not defined
> in Clang:
>
>
>
> __U?INT{_,_FAST,_LEAST}{8,16,32,64}_{MAX,TYPE}__
>
> __U?INT{PTR,MAX}_{MAX,TYPE}__
>
>
>
> Some of these macros are used in newlib's stdint.h, if they exist. It
> seems that it hasn't been thoroughly tested with Clang, however, as some
> macros are assumed to exist.
>
>
>
> Is it worth adding these to Clang?
>
>
> Yes, we should try to be compatible here, and generally it seems
> reasonable to define the fully expanded set of these.
>
>
>
> Yes please – these are very helpful – and  these are very likely to become
> C++Standard,
>

They're not, but the forms without the "__" are. We currently provide those
forms without having the compiler implicitly predefine them. (GCC defines
these as a convenience for its own <stdint.h> to use; Clang's <stdint.h>
doesn't use them, nor does glibc's one.)


> and also the floating-point specified-width versions proposed
>
>
>
> www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/*n3626*.pdf
> <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3626.pdf>
>
>
>
> (and the corresponding C macros in the identical Wg14 paper n1703)
>
>
>
> A fully working prototype using GCC developed by Christopher Kormanyos
> shows that these can be very useful, especially the floating-point types to
> facilitate 128-bit FP with C++, but also with single-board ‘bare–metal’
> embedded systems.
>
>
>
> Christopher Kormanyos will present an updated version showing how this is
> useful in practice at Rapperswil.
>
>
>
> Paul
>
>
>
>
>
> ---
>
> Paul A. Bristow
>
> Prizet Farmhouse
>
> Kendal UK LA8 8AB
>
> +44 01539 561830
>
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140613/90f11b7a/attachment.html>


More information about the cfe-dev mailing list