diff --git a/src/cil.ml b/src/cil.ml index de813b6db..8a28dc19e 100755 --- a/src/cil.ml +++ b/src/cil.ml @@ -2978,6 +2978,7 @@ let initGccBuiltins () : unit = H.add h "__builtin_inff" (floatType, [], false); H.add h "__builtin_infl" (longDoubleType, [], false); H.add h "__builtin_memcpy" (voidPtrType, [ voidPtrType; voidConstPtrType; sizeType ], false); + H.add h "__builtin_memchr" (voidPtrType, [voidConstPtrType; intType; ulongType], false); H.add h "__builtin_mempcpy" (voidPtrType, [ voidPtrType; voidConstPtrType; sizeType ], false); H.add h "__builtin_memset" (voidPtrType, [ voidPtrType; intType; intType ], false); @@ -3052,6 +3053,7 @@ let initGccBuiltins () : unit = H.add h "__builtin_sqrtl" (longDoubleType, [ longDoubleType ], false); H.add h "__builtin_stpcpy" (charPtrType, [ charPtrType; charConstPtrType ], false); + H.add h "__builtin_strcat" (charPtrType, [charPtrType; charConstPtrType], false); H.add h "__builtin_strchr" (charPtrType, [ charPtrType; intType ], false); H.add h "__builtin_strcmp" (intType, [ charConstPtrType; charConstPtrType ], false); H.add h "__builtin_strcpy" (charPtrType, [ charPtrType; charConstPtrType ], false); diff --git a/src/frontc/cparser.mly b/src/frontc/cparser.mly index 49a67ab1b..17fa5a34d 100644 --- a/src/frontc/cparser.mly +++ b/src/frontc/cparser.mly @@ -1645,6 +1645,7 @@ asmattr: /* empty */ { [] } | VOLATILE asmattr { ("volatile", []) :: $2 } | CONST asmattr { ("const", []) :: $2 } +| INLINE asmattr { ("inline", []) :: $2 } ; asmtemplate: one_string_constant { [$1] } @@ -1682,15 +1683,15 @@ asmopname: asmclobber: /* empty */ { [] } -| COLON asmcloberlst { $2 } +| COLON asmclobberlst { $2 } ; -asmcloberlst: +asmclobberlst: /* empty */ { [] } -| asmcloberlst_ne { $1 } +| asmclobberlst_ne { $1 } ; -asmcloberlst_ne: +asmclobberlst_ne: one_string_constant { [$1] } -| one_string_constant COMMA asmcloberlst_ne { $1 :: $3 } +| one_string_constant COMMA asmclobberlst_ne { $1 :: $3 } ; %% diff --git a/src/frontc/frontc.ml b/src/frontc/frontc.ml index dfc71f158..5efa6630d 100644 --- a/src/frontc/frontc.ml +++ b/src/frontc/frontc.ml @@ -106,6 +106,8 @@ let args : (string * Arg.spec * string) list = exception ParseError of string exception CabsOnly +let resetErrors () = E.hadErrors := false + (* parse, and apply patching *) let rec parse_to_cabs fname = begin diff --git a/src/frontc/frontc.mli b/src/frontc/frontc.mli index 0c0b9fe09..001d36166 100644 --- a/src/frontc/frontc.mli +++ b/src/frontc/frontc.mli @@ -47,6 +47,8 @@ val args: (string * Arg.spec * string) list (* the main command to parse a file. Return a thunk that can be used to convert the AST to CIL. *) +val resetErrors: unit -> unit + val parse: string -> (unit -> Cil.file) val parse_with_cabs: string -> (unit -> Cabs.file * Cil.file)