From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: __INT_FAST*_TYPE__ undefined
Date: Sun, 21 Aug 2016 18:58:00 -0000 [thread overview]
Message-ID: <20160821185849.nfbuhltzdhimkbyq@calimero.vinschen.de> (raw)
In-Reply-To: <20160821094133.GA9518@coil>
[-- Attachment #1: Type: text/plain, Size: 2105 bytes --]
Hey Kevin,
On Aug 21 11:41, Kévin wrote:
> Hi,
>
> I have an issue with compiling using newlib and stdint.
>
> issue
> -----
>
> when I compile against newlib I get the following error:
>
> clang -target arm-none-eabi -Os -g -std=c99 -nostdlib -nostdinc -fno-common -ffunction-sections -fdata-sections -ffreestanding -Wpedantic -Wall -Werror -Wextra -Wundef -Wshadow -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes -Wstrict-overflow=5 -I/usr/include/newlib/ -I/usr/lib/gcc/arm-none-eabi/*/include/ -I. -mthumb -mcpu=cortex-m3 -o global.o -c global.c
> In file included from global.c:21:
> In file included from /usr/include/newlib/stdint.h:13:
> /usr/include/newlib/sys/_intsup.h:118:6: error: '__INT_FAST8_TYPE__' is not defined, evaluates to 0 [-Werror,-Wundef]
> #if (__INT_FAST8_TYPE__ == 0)
> ...
>
> analysis
> --------
>
> global.c:21 is the following
> #include <stdint.h> // standard integer types
>
> I am not using the system library but newlib (-nostdlib -nostdinc -I/usr/include/newlib/)
> thus the stdint.h included is /usr/include/newlib/stdint.h
>
> stdint.h has the following (unconditional) include:
> #include <sys/_intsup.h>
>
> _intsup.h has the following defines:
> #if (__INT_FAST8_TYPE__ == 0)
> #define __FAST8 "hh"
> #elif (__INT_FAST8_TYPE__ == 1 || __INT_FAST8_TYPE__ == 3)
> #define __FAST8 "h"
> #elif (__INT_FAST8_TYPE__ == 2)
> #define __FAST8
> #elif (__INT_FAST8_TYPE__ == 4 || __INT_FAST8_TYPE__ == 6)
> #define __FAST8 "l"
> #elif (__INT_FAST8_TYPE__ == 8 || __INT_FAST8_TYPE__ == 10)
> #define __FAST8 "ll"
> #endif
> this applies to other _INT_FAST and _INT_LEAST
>
> but __INT_FAST8_TYPE__ is not defined anywhere in newlib, thus clang complains because I am using (-Werror -Wundef).
>
> solution
> --------
>
> __INT_FAST8_TYPE__ might be defined in another library such but not in the ones I use/include.
__INT_FAST8_TYPE__ is a GCC builtin, and I'd expect that clang follows suit.
IMHO this is a bug in the compiler.
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2016-08-21 18:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-21 9:41 Kévin
2016-08-21 18:58 ` Corinna Vinschen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160821185849.nfbuhltzdhimkbyq@calimero.vinschen.de \
--to=vinschen@redhat.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).