1# get the toolchain compiler and version from the environment
2-setq=used_compiler,getenv("CC_ALIASES")
3
4# Compilers.
5-file_tag+={GCC,"^used_compiler$"}
6# -file_tag+={GXX,"^/opt/zephyr-sdk-0\\.13\\.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-g\\+\\+$"}
7
8# Manuals.
9-setq=GCC_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-10.3.0/gcc.pdf"
10-setq=CPP_MANUAL,"https://gcc.gnu.org/onlinedocs/gcc-10.3.0/cpp.pdf"
11-setq=C99_STD,"ISO/IEC 9899:1999"
12
13-doc_begin="
14    See Chapter \"6 Extensions to the C Language Family\" of "GCC_MANUAL":
15    __auto_type: see \"6.7 Referring to a Type with typeof\";
16    __asm__: see \"6.48 Alternate Keywords\", and \"6.47 How to Use Inline Assembly Language in C Code\";
17    __attribute__: see \"6.39 Attribute Syntax\";
18    __typeof__: see \"6.7 Referring to a Type with typeof\";
19    __builtin_types_compatible_p: see \"6.59 Other Built-in Functions Provided by GCC\";
20    __volatile__: see \"6.48 Alternate Keywords\" and \"6.47.2.1 Volatile\";
21    __alignof: see \"6.48 Alternate Keywords\"  and \"6.44 Determining the Alignment of Functions, Types or
22Variables\";
23    __alignof__: see \"6.48 Alternate Keywords\"  and \"6.44 Determining the Alignment of Functions, Types or
24Variables\";
25    __const__: see \"6.48 Alternate Keywords\";
26    __inline: see \"6.48 Alternate Keywords\";
27    _Generic: see description of option \"-Wc99-c11-compat\" in \"3.8 Options to Request or Suppress Warnings\". The compiler allows to C11 features in C99 mode;
28    _Static_assert: see descriptions of options \"-Wc99-c11-compat\" and \"-Wc99-c2x-compat\" in \"3.8 Options to Request or Suppress Warnings\". The compiler allows to use C11 and C2x features in C99 mode.
29"
30-config=STD.tokenext,behavior+={c99, GCC, "^(__auto_type|__asm__|__attribute__|__typeof__|__builtin_types_compatible_p|__volatile__|__alignof|__alignof__|__const__|__inline|_Generic|_Static_assert)$"}
31-config=STD.tokenext,behavior+={c18, GCC, "^(__attribute__|__asm__|__const__|__volatile__|__inline)$"}
32-doc_end
33
34-doc="See Chapter \"6.7 Referring to a Type with typeof\". of "GCC_MANUAL"."
35-config=STD.diag,diagnostics={safe,"^ext_auto_type$"}
36-doc="See Chapter \"6.1 Statements and Declarations in Expressions\" of "GCC_MANUAL"."
37-config=STD.stmtexpr,behavior+={c99,GCC,specified}
38-doc="See Chapter \"6.24 Arithmetic on void- and Function-Pointers\" of "GCC_MANUAL"."
39-config=STD.vptrarth,behavior={c99,GCC,specified}
40-doc_begin="
41    ext_missing_varargs_arg: non-documented GCC extension.
42    ext_paste_comma: see Chapter \"6.21 Macros with a Variable Number of Arguments.\" of "GCC_MANUAL".
43    ext_flexible_array_in_array: see Chapter \"6.18 Arrays of Length Zero\" of "GCC_MANUAL".
44"
45-config=STD.diag,behavior+={c99,GCC,"^(ext_missing_varargs_arg|ext_paste_comma|ext_flexible_array_in_array)$"}
46-config=STD.diag,behavior+={c18,GCC,"^(ext_missing_varargs_arg)$"}
47-doc_end
48-doc_begin="Non-documented GCC extension"
49-config=STD.emptinit,behavior={c99,GCC,specified}
50-config=STD.emptinit,behavior={c18,GCC,specified}
51-doc_end
52-doc_begin="See Chapter \"6.19 Structures with No Members\" of "GCC_MANUAL"."
53-config=STD.emptrecd,behavior={c99,GCC,specified}
54-config=STD.emptrecd,behavior={c18,GCC,specified}
55-doc_end
56-doc="See Chapter \"6.18 Arrays of Length Zero\" of "GCC_MANUAL"."
57-config=STD.arayzero,behavior={c99,GCC,specified}
58
59-config=STD.inclnest,behavior+={c99, GCC, 24}
60-config=STD.ppifnest,behavior+={c99, GCC, 32}
61-config=STD.macident,behavior+={c99, GCC, 4096}
62
63-doc_begin="Allowed headers in freestanding mode."
64-config=STD.freestlb,behavior+={c99,GCC,"^(string|fcntl|time|errno|ctype|stdio|inttypes|stdlib).h$"}
65-config=STD.freestlb,behavior+={c18,GCC,"^(string|errno|inttypes).h$"}
66-doc_end
67
68-doc_begin="See Annex \"J.5.7 Function pointer casts\" of "C99_STD"."
69-config=STD.funojptr,behavior={c99,GCC,specified}
70-doc_end
71
72-doc_begin="The maximum size of an object is defined in the MAX_SIZE macro, and for a 32 bit architecture is 8MB.
73    The maximum size for an array is defined in the PTRDIFF_MAX and in a 32 bit architecture is 2^30-1."
74-config=STD.byteobjt,behavior={c99, GCC, 8388608}
75-doc_end
76
77-doc_begin="See Section \"6.62.13 Diagnostic Pragmas\" of "GCC_MANUAL"."
78-config=STD.nonstdc,behavior+={c99, GCC, "^GCC diagnostic (push|pop|ignored \"-W.*\")$"}
79-config=STD.nonstdc,behavior+={c18, GCC, "^GCC diagnostic (push|pop|ignored \"-W.*\")$"}
80-doc_end
81
82-doc_begin="See Section \"4.9 Structures, Unions, Enumerations, and Bit-Fields\" of "GCC_MANUAL". Other integer types, such as long int, and enumerated types are permitted even in strictly conforming mode."
83-config=STD.bitfldtp,behavior+={c99, GCC, "unsigned char||unsigned short"}
84-config=STD.bitfldtp,behavior+={c18, GCC, "unsigned char||unsigned short"}
85-doc_end
86