aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/include
Commit message (Collapse)AuthorAgeFilesLines
* Use define for wchar_t typeBernhard Schommer2023-02-011-6/+2
| | | | | | Since the wchar_t type depends on the architecture and the system we are compiling for we replace the typedef to a fixed type by a typedef to a define which is predefined by the compiler itself.
* <stddef.h>: define NULL with type void *Xavier Leroy2019-02-041-1/+1
| | | | | | | | | | | | | | ISO C2011 7.19 para 3 says "NULL, which expands to an implementation-defined null pointer constant" ISO C2011 6.3.2.3 para 3 says "An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant." So, it seems NULL can be defined either as "0" or as "(void *) 0". However, the two definitions are not equivalent in the context of a call to a variadic or unprototyped function: passing 0 when the function expects a pointer value can go wrong if sizeof(int) != sizeof(void *). This commit changes the definition of NULL to the safer one: This is what GCC and Clang do in C mode; they use "#define NULL 0" for C++ only. Fixes issue #265
* <stdbool.h>: add missing macro __bool_true_false_are_definedXavier Leroy2019-02-041-0/+1
| | | | | | As specified in ISO C99 section 7.16 and C11 section 7.18. Fixes issue #266
* Define the C11 type max_align_t (#115)Bernhard Schommer2018-05-241-0/+9
| | | | | | | The definition is similar to that of gcc, however since we don't support long doubles out of the box and long doubles are doubles in compat mode we can directly define max_align_t to be long long. Bug 23380
* Change the syntax to gcc/clangs syntax.Bernhard Schommer2017-02-011-1/+1
| | | | | | This only means that there must be one identifier at the begining and then a designator. Bug 20765
* New version to support designators.Bernhard Schommer2017-01-241-1/+1
| | | | | | | | | The c standard allows member designators for offsetof. The current implementation works by recursively combining the offset of each of the member designators. For array access the size of the subtypes is multiplied by the index and for members the offset of the member is calculated. Bug 20765
* Implement offsetof via builtin.Bernhard Schommer2017-01-201-1/+1
| | | | | | | | | | | | The implementation of offsetof as macro in the form ((size_t) &((ty*) NULL)->member) has the problem that it cannot be used everywhere were an integer constant expression is allowed, for example in initiliazers of global variables and there is also no check for the case that member is of bitifield type. The new implementation adds a builtin function for this which is replaced by an integer constant during elaboration. Bug 20765
* Added iso646 header for alternate spellings.Bernhard Schommer2016-04-061-0/+49
| | | | | | | The iso646 header defines some macros that expand to common operators. Both clang and gcc ship with them and they are required by the standard. Bug 18645.
* Added the _Noreturn keyword.Bernhard Schommer2016-03-232-0/+80
| | | | | | | | CompCert now recognizes the C11 _Noreturn function specifier and emits a simple warning for functions declared _Noreturn containing a return statement. Also the stdnoreturn header and additionally the stdalign header are added. Bug 18541
* Include fix for wint_t gcc problem.Bernhard Schommer2016-01-211-12/+16
| | | | | | Gcc defines wint_t in the stddef header (even if it is not stanadard) and additionally defines it if stddef is reincluded. The fix now defines it before stddef is checked for reinclusion.
* More gcc/newlib compatibility code.Bernhard Schommer2015-12-111-2/+13
| | | | | | | | | | Some newlib headers use the __extension__ keyword which suppresses warnings for gcc extensions in strict mode. CompCert now ignores this keyword for the gnu backends. Also it seems that stddef of the gcc defines wint_t even though it should not. However some libs rely on this. So wint_t is now defined in CompCert's stddef header. Bug 17613.
* Also test if the __VA_LIST macro is defined to avoid problems with the ↵Bernhard Schommer2015-07-091-2/+8
| | | | typedefs in stdio, etc. for the diab compiler.
* Removed brackets around ty in macro of offestof.Bernhard Schommer2015-07-071-1/+1
|
* Diab defines w_char to be unsigned short.Bernhard Schommer2015-07-071-1/+1
|
* Better define the __GNUC__ macro which avoids the inclusion of va_list ↵Bernhard Schommer2015-07-071-0/+4
| | | | header and set the __VA_LIST macro if it is not defined.
* Make also the wchar definition diab compatible.Bernhard Schommer2015-06-261-0/+15
|
* Added diab specific macros for stddef to avoid redefinition of size_t.Bernhard Schommer2015-06-261-0/+9
|
* Typo in #ifndef guard.Xavier Leroy2015-05-091-1/+1
|
* Improve compatibility with MacOS X.Xavier Leroy2015-04-261-0/+3
|
* Provide and use compiler-dependent standard headers.Xavier Leroy2015-04-255-0/+298
This branch provides implementations of the following standard headers: <float.h> <stdarg.h> <stdbool.h> <stddef.h> <varargs.h> These are the headers that are provided by GCC and Clang, as opposed to being provided by Glibc and similar C standard libraries. Configuration flag "-no-standard-headers" deactivates the installation and use of these headers. Lightly tested so far (IA32 Linux).