From mboxrd@z Thu Jan 1 00:00:00 1970 From: elfring@users.sourceforge.net (SF Markus Elfring) Date: Wed, 17 Dec 2014 21:30:05 +0100 Subject: [Cocci] Distinguishing pointer data types with SmPL In-Reply-To: References: <5478F848.1080808@users.sourceforge.net> <548371FB.9060402@users.sourceforge.net> <54837413.8000902@users.sourceforge.net> <5483806D.3070805@users.sourceforge.net> <5483902E.8060109@users.sourceforge.net> <54841AB2.6070609@users.sourceforge.net> <54842A73.4000203@users.sourceforge.net> <54842E04.9060800@users.sourceforge.net> <5484414F.4040900@users.sourceforge.net> <54846702.1000505@users.sourceforge.net> <5491A1A0.40809@users.sourceforge.net> Message-ID: <5491E7CD.3070207@users.sourceforge.net> To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr >> * Which is the best way to distinguish non-pointer types from pointer data types >> with metavariables? > > If you do the following: > > @@ > expression * e1; > expression e2; > @@ > > ( > e1 > | > e2 > ) > > Then e2 should match the non-pointer type expressions. Is it relevant if you use "expression" or "type" here? I guess that my previous use case was a bit different because the pointer distinction was distributed over function parameters in separate SmPL rules. I got the impression that a single metavariable with the SmPL type "type" might be insufficient for a selection if the asterisk is omitted there. Does the filter approach need to be disambiguated with additional criteria like variable constraints or a part from the function implementation? Regards, Markus