From 1e97bb4f6297b6fa7949684e522a592aab754d99 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Thu, 22 Jan 2015 19:26:05 +0100 Subject: Delay reads from !Machine.config before it is properly initialized. Several definitions in Cutil and elsewhere were accessing the default value of !Machine.config, before it is properly initialized in Driver. Delay evaluation of these definitions, and initialize Machine.config to nonsensical values so that lack of initialization is caught early (e.g. in Cutil.find_matching_*_kind). Also, following up on commit [3b8a094], don't use "wchar_t" typedef to type wide string literals, even if this typedef is in scope. The risk here is to hide an inconsistency between "wchar_t"'s definition in standard headers and CompCert's built-in definition. --- cparser/PackedStructs.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cparser/PackedStructs.ml') diff --git a/cparser/PackedStructs.ml b/cparser/PackedStructs.ml index 686a7d39..1f602fc1 100644 --- a/cparser/PackedStructs.ml +++ b/cparser/PackedStructs.ml @@ -138,7 +138,7 @@ let accessor_type loc env ty = match unroll env ty with | TInt(ik,_) -> (8 * sizeof_ikind ik, TInt(unsigned_ikind_of ik,[])) | TEnum(_,_) -> (8 * sizeof_ikind enum_ikind, TInt(unsigned_ikind_of enum_ikind,[])) - | TPtr _ -> (8 * !config.sizeof_ptr, TInt(ptr_t_ikind,[])) + | TPtr _ -> (8 * !config.sizeof_ptr, TInt(ptr_t_ikind(),[])) | _ -> error "%a: unsupported type for byte-swapped field access" formatloc loc; (32, TVoid []) -- cgit