On Tue, 28 Feb 2012, Julia Lawall wrote:
On Tue, 28 Feb 2012, ron minnich wrote:
I need to match something like this:
struct {
int x;
int y;
} d;
I tried:
struct {...} d;
and got a nameless struct error ... what should I be doing?
The following patch fixes the problem.
julia
diff --git a/parsing_cocci/ast0_cocci.ml b/parsing_cocci/ast0_cocci.ml
index 51e40e1..0deaa1d 100644
--- a/parsing_cocci/ast0_cocci.ml
+++ b/parsing_cocci/ast0_cocci.ml
@@ -654,7 +654,7 @@ let rec ast0_type_to_type ty =
perhaps polymorphism would help? *)
failwith "constraints not supported on struct type name"
| _ -> failwith "unexpected struct/union type name")
- | StructUnionName(su,None) -> failwith "nameless structure - what to do???"
+ | StructUnionName(su,None) -> TC.StructUnionName(structUnion su,TC.NoName)
| StructUnionDef(ty,_,_,_) -> ast0_type_to_type ty
| TypeName(name) -> TC.TypeName(unwrap_mcode name)
| MetaType(name,_) ->
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)