1# Compilers.
2-file_tag+={GCC_ARM64,"^/usr/bin/aarch64-linux-gnu-gcc-12$"}
3-file_tag+={GCC_X86_64,"^/usr/bin/x86_64-linux-gnu-gcc-12$"}
4
5# Manuals.
6-setq=GCC_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc.pdf"
7-setq=CPP_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-12.1.0/cpp.pdf"
8-setq=ARM64_ABI_MANUAL,"https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/aapcs64/aapcs64.rst"
9-setq=X86_64_ABI_MANUAL,"https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/artifacts/master/raw/x86-64-ABI/abi.pdf?job=build"
10-setq=ARM64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/libc.pdf"
11-setq=X86_64_LIBC_MANUAL,"https://www.gnu.org/software/libc/manual/pdf/libc.pdf"
12-setq=C99_STD,"ISO/IEC 9899:1999"
13
14-doc_begin="
15    _Static_assert: see Section \"2.1 C Language\" of "GCC_MANUAL".
16    asm, __asm__: see Sections \"6.48 Alternate Keywords\" and \"6.47 How to Use Inline Assembly Language in C Code\" of "GCC_MANUAL".
17    __volatile__: see Sections \"6.48 Alternate Keywords\" and \"6.47.2.1 Volatile\" of "GCC_MANUAL".
18    __const__ : see Section \"6.48 Alternate Keywords\" of "GCC_MANUAL".
19    typeof, __typeof__: see Section \"6.7 Referring to a Type with typeof\" of "GCC_MANUAL".
20    __alignof__, __alignof: see Sections \"6.48 Alternate Keywords\" and \"6.44 Determining the Alignment of Functions, Types or Variables\" of "GCC_MANUAL".
21    __attribute__: see Section \"6.39 Attribute Syntax\" of "GCC_MANUAL".
22    __builtin_types_compatible_p: see Section \"6.59 Other Built-in Functions Provided by GCC\" of "GCC_MANUAL".
23    __builtin_va_arg: non-documented GCC extension.
24    __builtin_offsetof: see Section \"6.53 Support for offsetof\" of "GCC_MANUAL".
25"
26-config=STD.tokenext,behavior+={c99, GCC_ARM64, "^(_Static_assert|asm|__asm__|__volatile__|__const__|typeof|__typeof__|__alignof__|__attribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof)$"}
27-config=STD.tokenext,behavior+={c99, GCC_X86_64, "^(_Static_assert|asm|__asm__|__volatile__|__const__|typeof|__typeof__|__alignof__|__alignof|__attribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof)$"}
28-doc_end
29
30-doc_begin="Non-documented GCC extension."
31-config=STD.emptinit,behavior+={c99,GCC_ARM64,specified}
32-config=STD.emptinit,behavior+={c99,GCC_X86_64,specified}
33#-config=STD.emptinit,behavior+={c18,GCC_X86_64,specified}
34-doc_end
35
36-doc_begin="See Section \"6.24 Arithmetic on void- and Function-Pointers\" of "GCC_MANUAL"."
37-config=STD.vptrarth,behavior+={c99,GCC_ARM64,specified}
38-config=STD.vptrarth,behavior+={c99,GCC_X86_64,specified}
39-doc_end
40
41-doc_begin="See Section \"6.1 Statements and Declarations in Expressions\" of "GCC_MANUAL"."
42-config=STD.stmtexpr,behavior+={c99,GCC_ARM64,specified}
43-config=STD.stmtexpr,behavior+={c99,GCC_X86_64,specified}
44-doc_end
45
46-doc_begin="See Section \"6.19 Structures with No Members\" of "GCC_MANUAL"."
47-config=STD.anonstct,behavior+={c99,GCC_ARM64,specified}
48-config=STD.anonstct,behavior+={c99,GCC_X86_64,specified}
49-doc_end
50
51-doc_begin="See Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL"."
52-config=STD.arayzero,behavior+={c99,GCC_ARM64,specified}
53-config=STD.arayzero,behavior+={c99,GCC_X86_64,specified}
54-doc_end
55
56-doc_begin="See Section \"6.8 Conditionals with Omitted Operands\" of "GCC_MANUAL"."
57-config=STD.bincondl,behavior+={c99,GCC_ARM64,specified}
58-config=STD.bincondl,behavior+={c99,GCC_X86_64,specified}
59-doc_end
60
61-doc_begin="See Section \"6.30 Case Ranges\" of "GCC_MANUAL"."
62-config=STD.caseuplw,behavior+={c99,GCC_ARM64,specified}
63-config=STD.caseuplw,behavior+={c99,GCC_X86_64,specified}
64-doc_end
65
66-doc_begin="See Section \"6.63 Unnamed Structure and Union Fields\" of "GCC_MANUAL"."
67-config=STD.anonfild,behavior+={c99,GCC_ARM64,specified}
68-config=STD.anonfild,behavior+={c99,GCC_X86_64,specified}
69-doc_end
70
71-doc_begin="Non-documented GCC extension."
72-config=STD.emptdecl,behavior+={c99,GCC_ARM64,specified}
73-config=STD.emptdecl,behavior+={c99,GCC_X86_64,specified}
74-doc_end
75
76-doc_begin="Non-documented GCC extension."
77-config=STD.emptenum,behavior+={c99,GCC_ARM64,specified}
78-doc_end
79
80-doc_begin="Non-documented GCC extension."
81-config=STD.pteincmp,behavior+={c99,GCC_ARM64,specified}
82-config=STD.pteincmp,behavior+={c99,GCC_X86_64,specified}
83#-config=STD.pteincmp,behavior+={c18,GCC_X86_64,specified}
84-doc_end
85
86-doc_begin="Non-documented GCC extension."
87-config=STD.funojptr,behavior+={c99,GCC_X86_64,specified}
88-doc_end
89
90-doc_begin="
91    ext_paste_comma: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
92    ext_missing_varargs_arg: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
93    ext_named_variadic_macro: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
94    ext_return_has_void_expr: see the documentation for -Wreturn-type in Section \"3.8 Options to Request or Suppress Warnings\" of "GCC_MANUAL".
95    ext_gnu_statement_expr_macro: see Section \"6.1 Statements and Declarations in Expressions\" of "GCC_MANUAL".
96    ext_sizeof_alignof_void_type: see Section \"6.24 Arithmetic on void- and Function-Pointers\" of "GCC_MANUAL".
97    ext_forward_ref_enum_def: see Section \"6.49 Incomplete enum Types\" of "GCC_MANUAL".
98    ext_flexible_array_in_struct: see Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL".
99    ext_flexible_array_in_array: see Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL".
100    ext_enum_value_not_int: non-documented GCC extension.
101    ext_gnu_array_range: see Section \"6.29 Designated Initializers\" of "GCC_MANUAL".
102"
103-config=STD.diag,behavior+={c99,GCC_ARM64,"^(ext_paste_comma|ext_missing_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_statement_expr_macro|ext_sizeof_alignof_void_type|ext_forward_ref_enum_def|ext_gnu_array_range)$"}
104-config=STD.diag,behavior+={c99,GCC_X86_64,"^(ext_paste_comma|ext_missing_varargs_arg|ext_named_variadic_macro|ext_return_has_void_expr|ext_gnu_statement_expr_macro|ext_sizeof_alignof_void_type|ext_flexible_array_in_struct|ext_flexible_array_in_array|ext_enum_value_not_int|ext_gnu_array_range)$"}
105-doc_end
106
107-doc_begin="The maximum size of an object is defined in the MAX_SIZE macro, and for a 32 bit architecture is 8MB.
108    The maximum size for an array is defined in the PTRDIFF_MAX and in a 32 bit architecture is 2^30-1.
109    See occurrences of these macros in "GCC_MANUAL"."
110-config=STD.byteobjt,behavior+={c99, GCC_ARM64, 8388608}
111-config=STD.byteobjt,behavior+={c99, GCC_X86_64, 8388608}
112-doc_end
113
114-doc_begin="See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
115-config=STD.charline,behavior+={c99, GCC_ARM64, 5000}
116-config=STD.charline,behavior+={c99, GCC_X86_64, 12000}
117-doc_end
118
119-doc_begin="See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
120-config=STD.inclnest,behavior+={c99, GCC_ARM64, 24}
121-config=STD.inclnest,behavior+={c99, GCC_X86_64, 32}
122-doc_end
123
124-doc_begin="FIXME: why is C90 used?"
125-config=STD.ppifnest,behavior+={c90, GCC_X86_64, 32}
126-doc_end
127
128-doc_begin="See Section \"4.12 Statements\" of "GCC_MANUAL"."
129-config=STD.caselimt,behavior+={c99, GCC_X86_64, 1500}
130-doc_end
131
132-doc_begin="See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
133-config=STD.stdtypes,behavior+={c99, GCC_X86_64, "__uint128_t"}
134-doc_end
135
136-doc_begin="FIXME: Non-documented GCC extension?"
137-config=STD.charescp,behavior={c99, GCC_X86_64, "^m$"}
138-doc_end
139
140-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\" of "GCC_MANUAL"."
141-config=STD.bitfldtp, +behavior={c99, GCC_ARM64, "unsigned char;unsigned short;unsigned long;unsigned long long"}
142-config=STD.bitfldtp, +behavior={c99, GCC_X86_64, "unsigned char;unsigned short;unsigned long;enum"}
143-doc_end
144
145-doc_begin="
146    #pragma pack: see Section \"6.62.11 Structure-Layout Pragmas\" of "GCC_MANUAL".
147    #pragma GCC visibility: see Section \"6.62.14 Visibility Pragmas\" of "GCC_MANUAL".
148"
149-config=STD.nonstdc,behavior={c99, GCC_ARM64, "^(pack\\(|GCC visibility (push|pop)).*$"}
150-config=STD.nonstdc,behavior={c99, GCC_X86_64, "^(pack\\(|GCC visibility (push|pop)).*$"}
151-doc_end
152
153-doc_begin="See Section \"1.1 Character sets\" of "CPP_MANUAL".  We assume the locale is not restricting any UTF-8 characters being part of the source character set."
154-config=STD.charset,behavior={c99, GCC_ARM64, "utf8"}
155-doc_end
156
157-doc_begin="See Section \"4.3 Identifiers\" of "GCC_MANUAL"."
158-config=STD.extidsig, behavior+={c99, GCC_ARM64, "63"}
159-config=STD.extidsig, behavior+={c99, GCC_X86_64, "63"}
160-doc_end
161
162#
163# Documentation for relied-upon implementation-defined behaviors (Dir 1.1)
164#
165
166-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"8.1 Data types\" of "ARM64_ABI_MANUAL"."
167-config=STD.bytebits,behavior={c99, GCC_ARM64, "8"}
168-config=STD.charsobj,behavior={c99, GCC_ARM64, "utf8"}
169-config=STD.charsval,behavior={c99, GCC_ARM64, "utf8"}
170-doc_end
171
172-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
173-config=STD.bytebits,behavior={c99, GCC_X86_64, "8"}
174-config=STD.charsobj,behavior={c99, GCC_X86_64, "utf8"}
175-config=STD.charsval,behavior={c99, GCC_X86_64, "utf8"}
176-doc_end
177
178-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and the documentation for -finput-charset=charset in the same manual."
179-config=STD.charsmap,behavior={c99, GCC_ARM64, "specified"}
180-config=STD.charsmap,behavior={c99, GCC_X86_64, "specified"}
181-doc_end
182
183-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and the documentation for -fexec-charset=charset and -finput-charset=charset in the same manual."
184-config=STD.charsmem,behavior={c99, GCC_ARM64, "utf8"}
185-config=STD.charsmem,behavior={c99, GCC_X86_64, "utf8"}
186-doc_end
187
188-doc_begin="See Section \"4.1 Translation\" of "GCC_MANUAL"."
189-config=STD.diagidnt,behavior={c99, GCC_ARM64, "specified"}
190-config=STD.diagidnt,behavior={c99, GCC_X86_64, "specified"}
191-doc_end
192
193-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and the documentation for -fexec-charset=charset in the same manual."
194-config=STD.execvals,behavior={c99, GCC_ARM64, "specified"}
195-config=STD.execvals,behavior={c99, GCC_X86_64, "specified"}
196-doc_end
197
198-doc_begin="Given that Xen is compiled in hosted mode, ECLAIR cannot exclude the independency from program termination implementation-defined behavior.  See \"Section 25.7 Program Termination\" of "ARM64_LIBC_MANUAL"."
199-config=STD.exitstat,behavior={c99, GCC_ARM64, "specified"}
200-doc_end
201
202-doc_begin="Given that Xen is compiled in hosted mode, ECLAIR cannot exclude the independency from program termination implementation-defined behavior.  See \"Section 25.7 Program Termination\" of "X86_64_LIBC_MANUAL"."
203-config=STD.exitstat,behavior={c99, GCC_X86_64, "specified"}
204-doc_end
205
206-doc_begin="See Chapter \"2 Header Files\" of "CPP_MANUAL"."
207-config=STD.inclangl,behavior={c99, GCC_ARM64, "specified"}
208-config=STD.inclangl,behavior={c99, GCC_X86_64, "specified"}
209-config=STD.inclfile,behavior={c99, GCC_ARM64, "specified"}
210-config=STD.inclfile,behavior={c99, GCC_X86_64, "specified"}
211-config=STD.inclhead,behavior={c99, GCC_ARM64, "specified"}
212-config=STD.inclhead,behavior={c99, GCC_X86_64, "specified"}
213-doc_end
214
215-doc_begin="See Section \"4.5 Integers\" of "GCC_MANUAL"."
216-config=STD.signdint,behavior={c99, GCC_ARM64, "specified"}
217-config=STD.signdint,behavior={c99, GCC_X86_64, "specified"}
218-doc_end
219
220-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapter \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
221-config=STD.objbytes,behavior={c99, GCC_ARM64, "specified"}
222-doc_end
223
224-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
225-config=STD.objbytes,behavior={c99, GCC_X86_64, "specified"}
226-doc_end
227
228-doc_begin="See Section \"3.4 Stringizing\" of "CPP_MANUAL"."
229-config=STD.stringfy,behavior={c99, GCC_ARM64, "specified"}
230-config=STD.stringfy,behavior={c99, GCC_X86_64, "specified"}
231-doc_end
232
233-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\"
234 of "GCC_MANUAL" and Section \"8.1.8 Bit-fields\" of "ARM64_ABI_MANUAL"."
235-config=STD.bitfldby,+behavior={c99, GCC_ARM64, "specified"}
236-config=STD.bitfldor,+behavior={c99, GCC_ARM64, "specified"}
237-doc_end
238
239-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\"
240 of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
241-config=STD.bitfldby,+behavior={c99, GCC_X86_64, "specified"}
242-config=STD.bitfldor,+behavior={c99, GCC_X86_64, "specified"}
243-doc_end
244
245-doc_begin="See Section \"4.10 Qualifiers\" of "GCC_MANUAL"."
246-config=STD.volatltp,+behavior={c99, GCC_ARM64, "specified"}
247-config=STD.volatltp,+behavior={c99, GCC_X86_64, "specified"}
248-doc_end
249
250-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapter \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
251-config=STD.stdmacro,behavior={c99, GCC_ARM64, "specified"}
252-doc_end
253
254-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
255-config=STD.stdmacro,behavior={c99, GCC_X86_64, "specified"}
256-doc_end
257
258-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
259-config=STD.widestng,behavior={c99, GCC_ARM64, "specified"}
260-config=STD.widestng,behavior={c99, GCC_X86_64, "specified"}
261-config=STD.multbtsl,behavior={c99, GCC_X86_64, "specified"}
262-doc_end
263
264-doc_begin="See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL" and Section \"7 Pragmas\" of "CPP_MANUAL"."
265-config=STD.pragmdir,behavior={c99, GCC_ARM64, "^(pack\\(|GCC visibility (push|pop)).*$"}
266-config=STD.pragmdir,behavior={c99, GCC_X86_64, "^(pack\\(|GCC visibility (push|pop)).*$"}
267-doc_end
268
269-doc_begin="See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
270-config=STD.extinttp,behavior={c99, GCC_X86_64, "__uint128_t"}
271-doc_end
272
273-doc_begin="See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
274-config=STD.inclexpd,behavior={c99, GCC_X86_64, "specified"}
275-doc_end
276