aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Diagnostics.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavierleroy@users.noreply.github.com>2022-09-19 16:37:17 +0200
committerGitHub <noreply@github.com>2022-09-19 16:37:17 +0200
commit994c6c34182606385140e5695e33c90507ce59ee (patch)
treee9291d64997dd3e2ac8660c0e6fbe1b9a597799e /cparser/Diagnostics.ml
parent103aa7074a9dd3b1bcb2864d52c89292a2ab7bff (diff)
downloadcompcert-994c6c34182606385140e5695e33c90507ce59ee.tar.gz
compcert-994c6c34182606385140e5695e33c90507ce59ee.zip
Support C11 Unicode string literals and character constants (#452)
* Support C11 Unicode string literals and character constants * Add tests for C11 string literals and character constants * Better error message for ill-formed universal character names E.g. \u followed by fewer than 4 hex digits, or \U followed by fewer than 8 hex digits. * Add new warning `invalid-utf8` for byte sequences that are not valid UTF8. The warning is activated but not fatal by default. * Warn on uses of C11 Unicode character constants and string literals This uses the `c11-extensions` warning, which is off by default. * Support preprocessing option -finput-charset= for GNU toolchains
Diffstat (limited to 'cparser/Diagnostics.ml')
-rw-r--r--cparser/Diagnostics.ml3
1 files changed, 3 insertions, 0 deletions
diff --git a/cparser/Diagnostics.ml b/cparser/Diagnostics.ml
index 483b0376..8a8a0c17 100644
--- a/cparser/Diagnostics.ml
+++ b/cparser/Diagnostics.ml
@@ -104,6 +104,7 @@ type warning_type =
| Tentative_incomplete_static
| Reduced_alignment
| Non_linear_cond_expr
+ | Invalid_UTF8
(* List of all warnings with default status.
"true" means the warning is active by default.
@@ -140,6 +141,7 @@ let all_warnings =
(Tentative_incomplete_static, false);
(Reduced_alignment, false);
(Non_linear_cond_expr, false);
+ (Invalid_UTF8, true);
]
(* List of active warnings *)
@@ -182,6 +184,7 @@ let string_of_warning = function
| Tentative_incomplete_static -> "tentative-incomplete-static"
| Reduced_alignment -> "reduced-alignment"
| Non_linear_cond_expr -> "non-linear-cond-expr"
+ | Invalid_UTF8 -> "invalid-utf8"
(* Activate the given warning *)
let activate_warning w () =