Mail Archives: djgpp-workers/2013/02/23/21:13:14
On 2013-02-17 17:43, Brian Inglis wrote:
> On 2013-02-17 09:13, Eli Zaretskii wrote:
>>> Date: Sun, 17 Feb 2013 16:18:23 +0100
>>> From: Juan Manuel Guerrero<juan DOT guerrero AT gmx DOT de>
>>>
>>> The only thing that must be cleared is if stdint.h shall be
>>> included before or after the "#ifndef __dj_ENFORCE_ANSI_FREESTANDING".
>>
>> After, of course. "Free standing" means without the library, so no
>> library components should be visible. Just look at all our headers,
>> and you will see that when __dj_ENFORCE_ANSI_FREESTANDING is defined,
>> the entire body of each header is skipped, which makes the header
>> files effectively empty for such a compilation.
>
> Architectural definitions are provided for a freestanding environment:
> C89 provided float.h limits.h stdarg.h stddef.h - I would expect
> stdint.h and inttypes.h to be provided - any one know what the standard
> says about stdint.h and inttypes.h?
ANSI online store has ISO/IEC 9899:2011 available as PDF for $30 as
INCITS/ISO/IEC 9899-2012 Information technology — Programming
languages — C.
C&V: Standard states in clause "4. Conformance" para 6:
...A conforming freestanding implementation shall accept any strictly
conforming program in which the use of the features specified in the
library clause (clause 7) is confined to the contents of the standard
headers <float.h>, <iso646.h>, <limits.h>, <stdalign.h>, <stdarg.h>,
<stdbool.h>, <stddef.h>, <stdint.h>, and <stdnoreturn.h>.
So the architectural definitions provided in the headers above should be
defined in both conforming hosted and freestanding implementations: i.e.
omit "#ifndef __dj_ENFORCE_ANSI_FREESTANDING" from the above headers or
place the definitions before and add a comment after that the
definitions are available in both hosted and freestanding conforming
implementations.
- Raw text -