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    __alignof__, __alignof: see Sections \"6.48 Alternate Keywords\" and \"6.44 Determining the Alignment of Functions, Types or Variables\" 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    __attribute__: see Section \"6.39 Attribute Syntax\" of "GCC_MANUAL".
18    __builtin_offsetof: see Section \"6.53 Support for offsetof\" of "GCC_MANUAL".
19    __builtin_types_compatible_p: see Section \"6.59 Other Built-in Functions Provided by GCC\" of "GCC_MANUAL".
20    __builtin_va_arg: non-documented GCC extension.
21    __const__, __inline__, __inline: see Section \"6.48 Alternate Keywords\" of "GCC_MANUAL".
22    _Static_assert: see Section \"2.1 C Language\" of "GCC_MANUAL".
23    typeof, __typeof__: see Section \"6.7 Referring to a Type with typeof\" of "GCC_MANUAL".
24    __volatile__: see Sections \"6.48 Alternate Keywords\" and \"6.47.2.1 Volatile\" of "GCC_MANUAL".
25"
26-name_selector+={alignof, "^(__alignof__|__alignof)$"}
27-name_selector+={asm, "^(__asm__|asm)$"}
28-name_selector+={attribute, "^__attribute__$"}
29-name_selector+={builtin_offsetof, "^__builtin_offsetof$"}
30-name_selector+={builtin_types_p, "^__builtin_types_compatible_p$"}
31-name_selector+={builtin_va_arg, "^__builtin_va_arg$"}
32-name_selector+={const, "^__const__$"}
33-name_selector+={inline, "^(__inline__|__inline)$"}
34-name_selector+={static_assert, "^_Static_assert$"}
35-name_selector+={typeof, "^(__typeof__|typeof)$"}
36-name_selector+={volatile, "^__volatile__$"}
37
38-config=STD.tokenext,behavior+={c99, GCC_ARM64||GCC_X86_64,
39"alignof||
40asm||
41attribute||
42builtin_offsetof||
43builtin_types_p||
44builtin_va_arg||
45const||
46inline||
47static_assert||
48typeof||
49volatile"
50}
51-doc_end
52
53-doc_begin="Non-documented GCC extension."
54-config=STD.emptinit,behavior+={c99,GCC_ARM64,specified}
55-config=STD.emptinit,behavior+={c99,GCC_X86_64,specified}
56-doc_end
57
58-doc_begin="See Section \"6.24 Arithmetic on void- and Function-Pointers\" of "GCC_MANUAL"."
59-config=STD.vptrarth,behavior+={c99,GCC_ARM64,specified}
60-config=STD.vptrarth,behavior+={c99,GCC_X86_64,specified}
61-doc_end
62
63-doc_begin="See Section \"6.1 Statements and Declarations in Expressions\" of "GCC_MANUAL"."
64-config=STD.stmtexpr,behavior+={c99,GCC_ARM64,specified}
65-config=STD.stmtexpr,behavior+={c99,GCC_X86_64,specified}
66-doc_end
67
68-doc_begin="See Section \"6.19 Structures with No Members\" of "GCC_MANUAL"."
69-config=STD.anonstct,behavior+={c99,GCC_ARM64,specified}
70-config=STD.anonstct,behavior+={c99,GCC_X86_64,specified}
71-doc_end
72
73-doc_begin="See Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL"."
74-config=STD.arayzero,behavior+={c99,GCC_ARM64,specified}
75-config=STD.arayzero,behavior+={c99,GCC_X86_64,specified}
76-doc_end
77
78-doc_begin="See Section \"6.8 Conditionals with Omitted Operands\" of "GCC_MANUAL"."
79-config=STD.bincondl,behavior+={c99,GCC_ARM64,specified}
80-config=STD.bincondl,behavior+={c99,GCC_X86_64,specified}
81-doc_end
82
83-doc_begin="See Section \"6.30 Case Ranges\" of "GCC_MANUAL"."
84-config=STD.caseuplw,behavior+={c99,GCC_ARM64,specified}
85-config=STD.caseuplw,behavior+={c99,GCC_X86_64,specified}
86-doc_end
87
88-doc_begin="See Section \"6.63 Unnamed Structure and Union Fields\" of "GCC_MANUAL"."
89-config=STD.anonfild,behavior+={c99,GCC_ARM64,specified}
90-config=STD.anonfild,behavior+={c99,GCC_X86_64,specified}
91-doc_end
92
93-doc_begin="Non-documented GCC extension."
94-config=STD.emptdecl,behavior+={c99,GCC_ARM64,specified}
95-config=STD.emptdecl,behavior+={c99,GCC_X86_64,specified}
96-doc_end
97
98-doc_begin="Non-documented GCC extension."
99-config=STD.emptenum,behavior+={c99,GCC_ARM64,specified}
100-doc_end
101
102-doc_begin="Non-documented GCC extension."
103-config=STD.pteincmp,behavior+={c99,GCC_ARM64,specified}
104-config=STD.pteincmp,behavior+={c99,GCC_X86_64,specified}
105-doc_end
106
107-doc_begin="Non-documented GCC extension."
108-config=STD.funojptr,behavior+={c99,GCC_X86_64,specified}
109-doc_end
110
111-doc_begin="See section \"6.3 Labels as Values\" of "GCC_MANUAL"."
112-config=STD.adrslabl,behavior={c99,GCC_ARM64,specified}
113-config=STD.adrslabl,behavior={c99,GCC_X86_64,specified}
114-doc_end
115
116-doc_begin="
117    ext_c_missing_varargs_arg: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
118    ext_enum_value_not_int: non-documented GCC extension.
119    ext_flexible_array_in_array: see Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL".
120    ext_flexible_array_in_struct: see Section \"6.18 Arrays of Length Zero\" of "GCC_MANUAL".
121    ext_forward_ref_enum_def: see Section \"6.49 Incomplete enum Types\" of "GCC_MANUAL".
122    ext_gnu_array_range: see Section \"6.29 Designated Initializers\" of "GCC_MANUAL".
123    ext_gnu_statement_expr_macro: see Section \"6.1 Statements and Declarations in Expressions\" of "GCC_MANUAL".
124    ext_named_variadic_macro: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
125    ext_paste_comma: see Section \"6.21 Macros with a Variable Number of Arguments\" of "GCC_MANUAL".
126    ext_return_has_void_expr: see the documentation for -Wreturn-type in Section \"3.8 Options to Request or Suppress Warnings\" of "GCC_MANUAL".
127    ext_sizeof_alignof_void_type: see Section \"6.24 Arithmetic on void- and Function-Pointers\" of "GCC_MANUAL".
128"
129-name_selector+={ext_c_missing_varargs_arg, "^ext_c_missing_varargs_arg$"}
130-name_selector+={ext_enum_value_not_int, "^ext_enum_value_not_int$"}
131-name_selector+={ext_flexible_array_in_array, "^ext_flexible_array_in_array$"}
132-name_selector+={ext_flexible_array_in_struct, "^ext_flexible_array_in_struct$"}
133-name_selector+={ext_forward_ref_enum_def, "^ext_forward_ref_enum_def$"}
134-name_selector+={ext_gnu_array_range, "^ext_gnu_array_range$"}
135-name_selector+={ext_gnu_statement_expr_macro, "^ext_gnu_statement_expr_macro$"}
136-name_selector+={ext_named_variadic_macro, "^ext_named_variadic_macro$"}
137-name_selector+={ext_paste_comma, "^ext_paste_comma$"}
138-name_selector+={ext_return_has_void_expr, "^ext_return_has_void_expr$"}
139-name_selector+={ext_sizeof_alignof_void_type, "^ext_sizeof_alignof_void_type$"}
140
141-config=STD.diag,behavior+={c99,GCC_ARM64,
142"ext_c_missing_varargs_arg||
143ext_forward_ref_enum_def||
144ext_gnu_array_range||
145ext_gnu_statement_expr_macro||
146ext_named_variadic_macro||
147ext_paste_comma||
148ext_return_has_void_expr||
149ext_sizeof_alignof_void_type"
150}
151-config=STD.diag,behavior+={c99,GCC_X86_64,
152"ext_c_missing_varargs_arg||
153ext_enum_value_not_int||
154ext_flexible_array_in_array||
155ext_flexible_array_in_struct||
156ext_gnu_array_range||
157ext_gnu_statement_expr_macro||
158ext_named_variadic_macro||
159ext_paste_comma||
160ext_return_has_void_expr||
161ext_sizeof_alignof_void_type"
162}
163-doc_end
164
165-doc_begin="The maximum size of an object is defined in the MAX_SIZE macro, and for a 32 bit architecture is 8MB.
166    The maximum size for an array is defined in the PTRDIFF_MAX and in a 32 bit architecture is 2^30-1.
167    See occurrences of these macros in "GCC_MANUAL"."
168-config=STD.byteobjt,behavior+={c99, GCC_ARM64, 8388608}
169-config=STD.byteobjt,behavior+={c99, GCC_X86_64, 8388608}
170-doc_end
171
172-doc_begin="See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
173-config=STD.charline,behavior+={c99, GCC_ARM64, 5000}
174-config=STD.charline,behavior+={c99, GCC_X86_64, 12000}
175-doc_end
176
177-doc_begin="See Section \"11.2 Implementation limits\" of "CPP_MANUAL"."
178-config=STD.inclnest,behavior+={c99, GCC_ARM64, 24}
179-config=STD.inclnest,behavior+={c99, GCC_X86_64, 32}
180-doc_end
181
182-doc_begin="FIXME: why is C90 used?"
183-config=STD.ppifnest,behavior+={c90, GCC_X86_64, 32}
184-doc_end
185
186-doc_begin="See Section \"4.12 Statements\" of "GCC_MANUAL"."
187-config=STD.caselimt,behavior+={c99, GCC_X86_64, 1500}
188-doc_end
189
190-doc_begin="See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
191-config=STD.stdtypes,behavior+={c99, GCC_X86_64, "__uint128_t"}
192-doc_end
193
194-doc_begin="FIXME: Non-documented GCC extension?"
195-config=STD.charescp,behavior={c99, GCC_X86_64, "^m$"}
196-doc_end
197
198-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\" of "GCC_MANUAL"."
199-config=STD.bitfldtp, +behavior={c99, GCC_ARM64, "unsigned char;unsigned short;unsigned long;unsigned long long"}
200-config=STD.bitfldtp, +behavior={c99, GCC_X86_64, "unsigned char;unsigned short;unsigned long;enum"}
201-doc_end
202
203-doc_begin="
204    #pragma pack: see Section \"6.62.11 Structure-Layout Pragmas\" of "GCC_MANUAL".
205    #pragma GCC visibility: see Section \"6.62.14 Visibility Pragmas\" of "GCC_MANUAL".
206"
207-config=STD.nonstdc,behavior={c99, GCC_ARM64, "^(pack\\(|GCC visibility (push|pop)).*$"}
208-config=STD.nonstdc,behavior={c99, GCC_X86_64, "^(pack\\(|GCC visibility (push|pop)).*$"}
209-doc_end
210
211-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."
212-config=STD.charset,behavior={c99, GCC_ARM64, "utf8"}
213-doc_end
214
215-doc_begin="See Section \"4.3 Identifiers\" of "GCC_MANUAL"."
216-config=STD.extidsig, behavior+={c99, GCC_ARM64, "63"}
217-config=STD.extidsig, behavior+={c99, GCC_X86_64, "63"}
218-doc_end
219
220#
221# Documentation for relied-upon implementation-defined behaviors (Dir 1.1)
222#
223
224-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"8.1 Data types\" of "ARM64_ABI_MANUAL"."
225-config=STD.bytebits,behavior={c99, GCC_ARM64, "8"}
226-config=STD.charsobj,behavior={c99, GCC_ARM64, "utf8"}
227-config=STD.charsval,behavior={c99, GCC_ARM64, "utf8"}
228-doc_end
229
230-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
231-config=STD.bytebits,behavior={c99, GCC_X86_64, "8"}
232-config=STD.charsobj,behavior={c99, GCC_X86_64, "utf8"}
233-config=STD.charsval,behavior={c99, GCC_X86_64, "utf8"}
234-doc_end
235
236-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and the documentation for -finput-charset=charset in the same manual."
237-config=STD.charsmap,behavior={c99, GCC_ARM64, "specified"}
238-config=STD.charsmap,behavior={c99, GCC_X86_64, "specified"}
239-doc_end
240
241-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."
242-config=STD.charsmem,behavior={c99, GCC_ARM64, "utf8"}
243-config=STD.charsmem,behavior={c99, GCC_X86_64, "utf8"}
244-doc_end
245
246-doc_begin="See Section \"4.1 Translation\" of "GCC_MANUAL"."
247-config=STD.diagidnt,behavior={c99, GCC_ARM64, "specified"}
248-config=STD.diagidnt,behavior={c99, GCC_X86_64, "specified"}
249-doc_end
250
251-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and the documentation for -fexec-charset=charset in the same manual."
252-config=STD.execvals,behavior={c99, GCC_ARM64, "specified"}
253-config=STD.execvals,behavior={c99, GCC_X86_64, "specified"}
254-doc_end
255
256-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"."
257-config=STD.exitstat,behavior={c99, GCC_ARM64, "specified"}
258-doc_end
259
260-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"."
261-config=STD.exitstat,behavior={c99, GCC_X86_64, "specified"}
262-doc_end
263
264-doc_begin="See Chapter \"2 Header Files\" of "CPP_MANUAL"."
265-config=STD.inclangl,behavior={c99, GCC_ARM64, "specified"}
266-config=STD.inclangl,behavior={c99, GCC_X86_64, "specified"}
267-config=STD.inclfile,behavior={c99, GCC_ARM64, "specified"}
268-config=STD.inclfile,behavior={c99, GCC_X86_64, "specified"}
269-config=STD.inclhead,behavior={c99, GCC_ARM64, "specified"}
270-config=STD.inclhead,behavior={c99, GCC_X86_64, "specified"}
271-doc_end
272
273-doc_begin="See Section \"4.5 Integers\" of "GCC_MANUAL"."
274-config=STD.signdint,behavior={c99, GCC_ARM64, "specified"}
275-config=STD.signdint,behavior={c99, GCC_X86_64, "specified"}
276-doc_end
277
278-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapter \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
279-config=STD.objbytes,behavior={c99, GCC_ARM64, "specified"}
280-doc_end
281
282-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
283-config=STD.objbytes,behavior={c99, GCC_X86_64, "specified"}
284-doc_end
285
286-doc_begin="See Section \"3.4 Stringizing\" of "CPP_MANUAL"."
287-config=STD.stringfy,behavior={c99, GCC_ARM64, "specified"}
288-config=STD.stringfy,behavior={c99, GCC_X86_64, "specified"}
289-doc_end
290
291-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\"
292 of "GCC_MANUAL" and Section \"8.1.8 Bit-fields\" of "ARM64_ABI_MANUAL"."
293-config=STD.bitfldby,+behavior={c99, GCC_ARM64, "specified"}
294-config=STD.bitfldor,+behavior={c99, GCC_ARM64, "specified"}
295-doc_end
296
297-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\"
298 of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
299-config=STD.bitfldby,+behavior={c99, GCC_X86_64, "specified"}
300-config=STD.bitfldor,+behavior={c99, GCC_X86_64, "specified"}
301-doc_end
302
303-doc_begin="See Section \"4.10 Qualifiers\" of "GCC_MANUAL"."
304-config=STD.volatltp,+behavior={c99, GCC_ARM64, "specified"}
305-config=STD.volatltp,+behavior={c99, GCC_X86_64, "specified"}
306-doc_end
307
308-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Chapter \"5   Data types and alignment\" of "ARM64_ABI_MANUAL"."
309-config=STD.stdmacro,behavior={c99, GCC_ARM64, "specified"}
310-doc_end
311
312-doc_begin="See Section \"4.15 Architecture\" of "GCC_MANUAL" and Section \"3.1.2 Data Representation\" of "X86_64_ABI_MANUAL"."
313-config=STD.stdmacro,behavior={c99, GCC_X86_64, "specified"}
314-doc_end
315
316-doc_begin="See Section \"4.4 Characters\" of "GCC_MANUAL" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
317-config=STD.widestng,behavior={c99, GCC_ARM64, "specified"}
318-config=STD.widestng,behavior={c99, GCC_X86_64, "specified"}
319-config=STD.multbtsl,behavior={c99, GCC_X86_64, "specified"}
320-doc_end
321
322-doc_begin="See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL" and Section \"7 Pragmas\" of "CPP_MANUAL"."
323-config=STD.pragmdir,behavior={c99, GCC_ARM64, "^(pack\\(|GCC visibility (push|pop)).*$"}
324-config=STD.pragmdir,behavior={c99, GCC_X86_64, "^(pack\\(|GCC visibility (push|pop)).*$"}
325-doc_end
326
327-doc_begin="See Section \"6.9 128-bit Integers\" of "GCC_MANUAL"."
328-config=STD.extinttp,behavior={c99, GCC_X86_64, "__uint128_t"}
329-doc_end
330
331-doc_begin="See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
332-config=STD.inclexpd,behavior={c99, GCC_X86_64, "specified"}
333-doc_end
334