2014-12-03 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/inttypes.h: Only enable the 8-bit scanning macros if _WANT_IO_C99_FORMATS is defined by configuration. Add comment on why.
This commit is contained in:
parent
c9cfd71d8c
commit
8c049028d9
@ -1,3 +1,9 @@
|
|||||||
|
2014-12-03 Jeff Johnston <jjohnstn@redhat.com>
|
||||||
|
|
||||||
|
* libc/include/inttypes.h: Only enable the 8-bit scanning macros
|
||||||
|
if _WANT_IO_C99_FORMATS is defined by configuration. Add comment
|
||||||
|
on why.
|
||||||
|
|
||||||
2014-11-28 Matthew Fortune <matthew.fortune@imgtec.com>
|
2014-11-28 Matthew Fortune <matthew.fortune@imgtec.com>
|
||||||
|
|
||||||
* libc/include/machine/setjmp.h [__mips__]: Remove __mips_fpr == 64
|
* libc/include/machine/setjmp.h [__mips__]: Remove __mips_fpr == 64
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#ifndef _INTTYPES_H
|
#ifndef _INTTYPES_H
|
||||||
#define _INTTYPES_H
|
#define _INTTYPES_H
|
||||||
|
|
||||||
|
#include <newlib.h>
|
||||||
#include <sys/_intsup.h>
|
#include <sys/_intsup.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#define __need_wchar_t
|
#define __need_wchar_t
|
||||||
@ -22,7 +23,20 @@
|
|||||||
|
|
||||||
/* 8-bit types */
|
/* 8-bit types */
|
||||||
#define __PRI8(x) __STRINGIFY(x)
|
#define __PRI8(x) __STRINGIFY(x)
|
||||||
#define __SCN8(x) __STRINGIFY(hh##x)
|
|
||||||
|
/* NOTICE: scanning 8-bit types requires use of the hh specifier
|
||||||
|
* which is only supported on newlib platforms that
|
||||||
|
* are built with C99 I/O format support enabled. If the flag in
|
||||||
|
* newlib.h hasn't been set during configuration to indicate this, the 8-bit
|
||||||
|
* scanning format macros are disabled here as they result in undefined
|
||||||
|
* behaviour which can include memory overwrite. Overriding the flag after the
|
||||||
|
* library has been built is not recommended as it will expose the underlying
|
||||||
|
* undefined behaviour.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(_WANT_IO_C99_FORMATS)
|
||||||
|
#define __SCN8(x) __STRINGIFY(hh##x)
|
||||||
|
#endif /* _WANT_IO_C99_FORMATS */
|
||||||
|
|
||||||
|
|
||||||
#define PRId8 __PRI8(d)
|
#define PRId8 __PRI8(d)
|
||||||
@ -32,12 +46,17 @@
|
|||||||
#define PRIx8 __PRI8(x)
|
#define PRIx8 __PRI8(x)
|
||||||
#define PRIX8 __PRI8(X)
|
#define PRIX8 __PRI8(X)
|
||||||
|
|
||||||
|
/* Macros below are only enabled for a newlib built with C99 I/O format support. */
|
||||||
|
#if defined(_WANT_IO_C99_FORMATS)
|
||||||
|
|
||||||
#define SCNd8 __SCN8(d)
|
#define SCNd8 __SCN8(d)
|
||||||
#define SCNi8 __SCN8(i)
|
#define SCNi8 __SCN8(i)
|
||||||
#define SCNo8 __SCN8(o)
|
#define SCNo8 __SCN8(o)
|
||||||
#define SCNu8 __SCN8(u)
|
#define SCNu8 __SCN8(u)
|
||||||
#define SCNx8 __SCN8(x)
|
#define SCNx8 __SCN8(x)
|
||||||
|
|
||||||
|
#endif /* _WANT_IO_C99_FORMATS */
|
||||||
|
|
||||||
|
|
||||||
#define PRIdLEAST8 __PRI8(d)
|
#define PRIdLEAST8 __PRI8(d)
|
||||||
#define PRIiLEAST8 __PRI8(i)
|
#define PRIiLEAST8 __PRI8(i)
|
||||||
@ -46,12 +65,16 @@
|
|||||||
#define PRIxLEAST8 __PRI8(x)
|
#define PRIxLEAST8 __PRI8(x)
|
||||||
#define PRIXLEAST8 __PRI8(X)
|
#define PRIXLEAST8 __PRI8(X)
|
||||||
|
|
||||||
#define SCNdLEAST8 __SCN8(d)
|
/* Macros below are only enabled for a newlib built with C99 I/O format support. */
|
||||||
#define SCNiLEAST8 __SCN8(i)
|
#if defined(_WANT_IO_C99_FORMATS)
|
||||||
#define SCNoLEAST8 __SCN8(o)
|
|
||||||
#define SCNuLEAST8 __SCN8(u)
|
|
||||||
#define SCNxLEAST8 __SCN8(x)
|
|
||||||
|
|
||||||
|
#define SCNdLEAST8 __SCN8(d)
|
||||||
|
#define SCNiLEAST8 __SCN8(i)
|
||||||
|
#define SCNoLEAST8 __SCN8(o)
|
||||||
|
#define SCNuLEAST8 __SCN8(u)
|
||||||
|
#define SCNxLEAST8 __SCN8(x)
|
||||||
|
|
||||||
|
#endif /* _WANT_IO_C99_FORMATS */
|
||||||
|
|
||||||
#define PRIdFAST8 __PRI8(d)
|
#define PRIdFAST8 __PRI8(d)
|
||||||
#define PRIiFAST8 __PRI8(i)
|
#define PRIiFAST8 __PRI8(i)
|
||||||
@ -60,11 +83,16 @@
|
|||||||
#define PRIxFAST8 __PRI8(x)
|
#define PRIxFAST8 __PRI8(x)
|
||||||
#define PRIXFAST8 __PRI8(X)
|
#define PRIXFAST8 __PRI8(X)
|
||||||
|
|
||||||
#define SCNdFAST8 __SCN8(d)
|
/* Macros below are only enabled for a newlib built with C99 I/O format support. */
|
||||||
#define SCNiFAST8 __SCN8(i)
|
#if defined(_WANT_IO_C99_FORMATS)
|
||||||
#define SCNoFAST8 __SCN8(o)
|
|
||||||
#define SCNuFAST8 __SCN8(u)
|
#define SCNdFAST8 __SCN8(d)
|
||||||
#define SCNxFAST8 __SCN8(x)
|
#define SCNiFAST8 __SCN8(i)
|
||||||
|
#define SCNoFAST8 __SCN8(o)
|
||||||
|
#define SCNuFAST8 __SCN8(u)
|
||||||
|
#define SCNxFAST8 __SCN8(x)
|
||||||
|
|
||||||
|
#endif /* _WANT_IO_C99_FORMATS */
|
||||||
|
|
||||||
/* 16-bit types */
|
/* 16-bit types */
|
||||||
#define __PRI16(x) __STRINGIFY(x)
|
#define __PRI16(x) __STRINGIFY(x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user