From 3c47216fe945a45834daa38f71e287dcfaf345c7 Mon Sep 17 00:00:00 2001 From: Moody Liu Date: Tue, 5 Sep 2023 00:47:48 +0800 Subject: clike compilers: fix cross_* functions' include A standard C library may not exist for cross-compile environments, thus the existence of cannot be guaranteed. Use instead, this header contains compiler-specific defines thus it usually comes from the compiler. --- docs/yaml/objects/compiler.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'docs/yaml/objects') diff --git a/docs/yaml/objects/compiler.yaml b/docs/yaml/objects/compiler.yaml index 977cbdf0d..239a9bcfd 100644 --- a/docs/yaml/objects/compiler.yaml +++ b/docs/yaml/objects/compiler.yaml @@ -180,7 +180,11 @@ methods: - name: alignment returns: int - description: Returns the alignment of the specified type. + description: | + Returns the alignment of the specified type. For C-like languages, + For C-like languages, the header `stddef.h` and `stdio.h` are included + implicitly for native compilation, only `stddef.h` is included when + cross-compiling. posargs: typename: @@ -283,6 +287,9 @@ methods: (defaults to -1024), `high` (defaults to 1024) and `guess` to specify max and min values for the search and the value to try first. + For C-like languages, the header `stddef.h` and `stdio.h` are included + implicitly for native compilation, only `stddef.h` is included when + cross-compiling. posargs: expr: @@ -304,7 +311,11 @@ methods: - name: sizeof returns: int - description: returns the size of the given type (e.g. `'int'`) or -1 if the type is unknown. + description: | + returns the size of the given type (e.g. `'int'`) or -1 if the type is unknown. + For C-like languages, the header `stddef.h` and `stdio.h` are included + implicitly for native compilation, only `stddef.h` is included when + cross-compiling. kwargs_inherit: compiler._common posargs: typename: -- cgit v1.2.3