Skip to content
Snippets Groups Projects
Commit d6acc72c authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[machdep] Improve YAML generation for archs with incomplete C stdlib

Basically fields corresponding to undefined macros will properly be
associated to null instead of the macro name itself.

We do it even for macros that are supposedly defined by a standard compliant
C library, so that we can cope with more exotic implementations
parent 44aace84
No related branches found
No related tags found
No related merge requests found
...@@ -713,8 +713,8 @@ errno: ...@@ -713,8 +713,8 @@ errno:
etimedout: ((int)(66072050 & 0xffff)) etimedout: ((int)(66072050 & 0xffff))
ewouldblock: ((int)(66072050 & 0xffff)) ewouldblock: ((int)(66072050 & 0xffff))
exdev: ((int)(66072050 & 0xffff)) exdev: ((int)(66072050 & 0xffff))
filename_max: FILENAME_MAX filename_max: null
fopen_max: FOPEN_MAX fopen_max: null
has__builtin_va_list: true has__builtin_va_list: true
host_name_max: '64' host_name_max: '64'
int_fast16_t: int int_fast16_t: int
...@@ -722,7 +722,7 @@ int_fast32_t: long ...@@ -722,7 +722,7 @@ int_fast32_t: long
int_fast64_t: long long int_fast64_t: long long
int_fast8_t: signed char int_fast8_t: signed char
intptr_t: int intptr_t: int
l_tmpnam: L_tmpnam l_tmpnam: null
little_endian: true little_endian: true
machdep_name: machdep_avr_16 machdep_name: machdep_avr_16
mb_cur_max: ((size_t)16) mb_cur_max: ((size_t)16)
...@@ -745,7 +745,7 @@ sizeof_short: 2 ...@@ -745,7 +745,7 @@ sizeof_short: 2
sizeof_void: 1 sizeof_void: 1
ssize_t: '' ssize_t: ''
time_t: unsigned long time_t: unsigned long
tmp_max: TMP_MAX tmp_max: null
tty_name_max: '32' tty_name_max: '32'
uint_fast16_t: unsigned int uint_fast16_t: unsigned int
uint_fast32_t: unsigned long uint_fast32_t: unsigned long
......
...@@ -712,8 +712,8 @@ errno: ...@@ -712,8 +712,8 @@ errno:
etimedout: ((int)(66072050 & 0xffff)) etimedout: ((int)(66072050 & 0xffff))
ewouldblock: ((int)(66072050 & 0xffff)) ewouldblock: ((int)(66072050 & 0xffff))
exdev: ((int)(66072050 & 0xffff)) exdev: ((int)(66072050 & 0xffff))
filename_max: FILENAME_MAX filename_max: null
fopen_max: FOPEN_MAX fopen_max: null
has__builtin_va_list: true has__builtin_va_list: true
host_name_max: '64' host_name_max: '64'
int_fast16_t: int int_fast16_t: int
...@@ -721,7 +721,7 @@ int_fast32_t: long ...@@ -721,7 +721,7 @@ int_fast32_t: long
int_fast64_t: long long int_fast64_t: long long
int_fast8_t: signed char int_fast8_t: signed char
intptr_t: int intptr_t: int
l_tmpnam: L_tmpnam l_tmpnam: null
little_endian: true little_endian: true
machdep_name: machdep_avr_8 machdep_name: machdep_avr_8
mb_cur_max: ((size_t)16) mb_cur_max: ((size_t)16)
...@@ -744,7 +744,7 @@ sizeof_short: 2 ...@@ -744,7 +744,7 @@ sizeof_short: 2
sizeof_void: 1 sizeof_void: 1
ssize_t: '' ssize_t: ''
time_t: unsigned long time_t: unsigned long
tmp_max: TMP_MAX tmp_max: null
tty_name_max: '32' tty_name_max: '32'
uint_fast16_t: unsigned int uint_fast16_t: unsigned int
uint_fast32_t: unsigned long uint_fast32_t: unsigned long
......
...@@ -23,9 +23,15 @@ ...@@ -23,9 +23,15 @@
#include <errno.h> #include <errno.h>
/* Mandatory */ /* Mandatory */
#ifdef EDOM
int edom_is = EDOM; int edom_is = EDOM;
#endif
#ifdef EILSEQ
int eilseq_is = EILSEQ; int eilseq_is = EILSEQ;
#endif
#ifdef ERANGE
int erange_is = ERANGE; int erange_is = ERANGE;
#endif
/* Implementation defined by POSIX and GNU Linux */ /* Implementation defined by POSIX and GNU Linux */
#ifdef E2BIG #ifdef E2BIG
......
...@@ -22,6 +22,14 @@ ...@@ -22,6 +22,14 @@
#include <limits.h> #include <limits.h>
#if defined(PATH_MAX)
int path_max_is = PATH_MAX; int path_max_is = PATH_MAX;
#endif
#if defined(TTY_NAME_MAX)
int tty_name_max_is = TTY_NAME_MAX; int tty_name_max_is = TTY_NAME_MAX;
#endif
#if defined(HOST_NAME_MAX)
int host_name_max_is = HOST_NAME_MAX; int host_name_max_is = HOST_NAME_MAX;
#endif
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <unistd.h> #include <unistd.h>
#ifdef _POSIX_VERSION #if defined(_POSIX_VERSION)
long posix_version_is = _POSIX_VERSION; long posix_version_is = _POSIX_VERSION;
#else #else
#error "not a posix arch" #error "not a posix arch"
......
...@@ -22,9 +22,21 @@ ...@@ -22,9 +22,21 @@
#include <stdio.h> #include <stdio.h>
#if defined(BUFSIZ)
int bufsiz_is = BUFSIZ; int bufsiz_is = BUFSIZ;
#endif
#if defined(EOF)
int eof_is = EOF; int eof_is = EOF;
#endif
#if defined(FOPEN_MAX)
int fopen_max_is = FOPEN_MAX; int fopen_max_is = FOPEN_MAX;
#endif
#if defined(FILENAME_MAX)
int filename_max_is = FILENAME_MAX; int filename_max_is = FILENAME_MAX;
#endif
#if defined(L_tmpnam)
int l_tmpnam_is = L_tmpnam; int l_tmpnam_is = L_tmpnam;
#endif
#if defined(TMP_MAX)
int tmp_max_is = TMP_MAX; int tmp_max_is = TMP_MAX;
#endif
...@@ -23,9 +23,14 @@ ...@@ -23,9 +23,14 @@
#include <limits.h> #include <limits.h>
#include <stdlib.h> #include <stdlib.h>
#if defined(RAND_MAX)
int rand_max_is = RAND_MAX; int rand_max_is = RAND_MAX;
#endif
/* NB: MB_LEN_MAX is the maximal value of MB_CUR_MAX; /* NB: MB_LEN_MAX is the maximal value of MB_CUR_MAX;
however, the current Frama-C libc is not equipped to however, the current Frama-C libc is not equipped to
fully deal with a non-constant MB_CUR_MAX fully deal with a non-constant MB_CUR_MAX
*/ */
#if defined(MB_LEN_MAX)
size_t mb_cur_max_is = ((size_t)MB_LEN_MAX); size_t mb_cur_max_is = ((size_t)MB_LEN_MAX);
#endif
...@@ -22,4 +22,6 @@ ...@@ -22,4 +22,6 @@
#include <wchar.h> #include <wchar.h>
#if defined(WEOF)
const wint_t weof_is = WEOF; const wint_t weof_is = WEOF;
#endif
...@@ -21,4 +21,7 @@ ...@@ -21,4 +21,7 @@
/**************************************************************************/ /**************************************************************************/
#include <features.h> #include <features.h>
#if defined(__WORDSIZE)
const int wordsize_is = __WORDSIZE; const int wordsize_is = __WORDSIZE;
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment