From d50509fb3a74cae6c5851eeff2b54fba5cfd425c Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 9 Mar 2018 09:50:35 +0100 Subject: Do not use default printer for variable names. Printing variable names with the default expression printer results in newlines in the outputed error message. Bug 23169 --- backend/AisAnnot.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'backend/AisAnnot.ml') diff --git a/backend/AisAnnot.ml b/backend/AisAnnot.ml index 27005561..c5fade24 100644 --- a/backend/AisAnnot.ml +++ b/backend/AisAnnot.ml @@ -188,8 +188,14 @@ let validate_ais_annot env loc txt args = Array.set used_params (n-1) true; if Cutil.is_float_type env arg.C.etyp then error loc "floating point types for parameter '%s' are not supported in ais annotations" s - else if Cutil.is_volatile_variable env arg then - error loc "access to volatile variable '%a' for parameter '%s' is not supported in ais annotations" Cprint.exp (0,arg) s + else if Cutil.is_volatile_variable env arg then begin + let arg = + match arg.C.edesc with + | C.EVar id -> id.C.name + | _ -> assert false + in + error loc "access to volatile variable '%s' for parameter '%s' is not supported in ais annotations" arg s + end with _ -> error loc "unknown parameter '%s'" s in List.iter fragment (Str.full_split re_ais_annot_param txt); -- cgit