Hi
I would like CIL to ignore __builtin_offsetof().
But I just can't get the types right. Is there some sort of 'anyType' or a way
to ignore the types? Or perhaps a totally different approach?
Thanks.
(Sorry for flooding your mailinglist!)
diff -ur original/cil-1.4.0/src/cil.ml cil-1.4.0/src/cil.ml
--- original/cil-1.4.0/src/cil.ml 2012-05-16 21:25:01.240049061 +0200
+++ cil-1.4.0/src/cil.ml 2012-05-16 21:23:53.434001717 +0200
@@ -2980,6 +2980,8 @@
H.add h "__builtin_nansl" (longDoubleType, [ charConstPtrType ], false);
H.add h "__builtin_next_arg" ((if hasbva then TBuiltin_va_list [] else
voidPtrType), [], false) (* When we parse builtin_next_arg we drop the argument
*);
H.add h "__builtin_object_size" (sizeType, [ voidPtrType; intType ], false);
+
+ H.add h "__builtin_offsetof" (intType, [ string; string ] , false);
H.add h "__builtin_parity" (intType, [ uintType ], false);
H.add h "__builtin_parityl" (intType, [ ulongType ], false);
Only in cil-1.4.0/src: .cil.ml.swp
Only in cil-1.4.0/src: formatparse.output
diff -ur original/cil-1.4.0/src/frontc/clexer.mll
cil-1.4.0/src/frontc/clexer.mll
--- original/cil-1.4.0/src/frontc/clexer.mll 2012-05-16 21:25:01.245050639
+0200
+++ cil-1.4.0/src/frontc/clexer.mll 2012-05-16 20:56:14.361017922 +0200
@@ -111,7 +111,7 @@
(*
** Keyword hashtable
*)
-let lexicon = H.create 211
+let lexicon = H.create 210
let init_lexicon _ =
H.clear lexicon;
List.iter
@@ -213,7 +213,6 @@
fun _ -> NAMED_TYPE ("__builtin_va_list", currentLoc ()));
("__builtin_va_arg", fun loc -> BUILTIN_VA_ARG loc);
("__builtin_types_compatible_p", fun loc -> BUILTIN_TYPES_COMPAT loc);
- ("__builtin_offsetof", fun loc -> BUILTIN_OFFSETOF loc);
(* On some versions of GCC __thread is a regular identifier *)
("__thread", fun loc ->
if !Machdep.theMachine.Machdep.__thread_is_keyword then
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
CIL-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cil-users