Re: [Cocci] Automatic replacement of function declarations

2017-08-28 Thread Julia Lawall
On Sun, 27 Aug 2017, Kees Cook wrote: > Hi, > > So, I noticed that if I replace argument types in a function, > coccinelle will normally replace them in any forward declarations too. > However, this: > > @change_callback > depends on patch@ > identifier _callback; > type _origtype; >

[Cocci] Automatic replacement of function declarations

2017-08-28 Thread Kees Cook
Hi, So, I noticed that if I replace argument types in a function, coccinelle will normally replace them in any forward declarations too. However, this: @change_callback depends on patch@ identifier _callback; type _origtype; identifier _origarg; type _handletype; identifier _handle; @@ void

Re: [Cocci] Automatic replacement of function declarations

2017-08-28 Thread Julia Lawall
On Sun, 27 Aug 2017, Kees Cook wrote: > Hi, > > So, I noticed that if I replace argument types in a function, > coccinelle will normally replace them in any forward declarations too. > However, this: > > @change_callback > depends on patch@ > identifier _callback; > type _origtype; >

Re: [Cocci] Automatic replacement of function declarations

2017-08-28 Thread Julia Lawall
On Sun, 27 Aug 2017, Kees Cook wrote: > Hi, > > So, I noticed that if I replace argument types in a function, > coccinelle will normally replace them in any forward declarations too. > However, this: > > @change_callback > depends on patch@ > identifier _callback; > type _origtype; >

[Cocci] update

2017-08-28 Thread Julia Lawall
There was a bug in the include file management that could cause --recursive-includes to go into an infinite loop. That is now fixed. There is also now support for conjunctions on types. That is: @@ type t; identifier i; @@ ( struct i & t ) will now bind both i and t appropriately. julia

Re: [Cocci] Addition of support for variable attributes

2017-08-28 Thread SF Markus Elfring
> It is now (github) possible to match and transform a single such attribute > when it comes after the name of a variable in a variable declaration. This is a nice extension for your software. How does this information fit to the wording in the manual?

Re: [Cocci] Addition of support for conjunctions on types

2017-08-28 Thread Julia Lawall
On Mon, 28 Aug 2017, SF Markus Elfring wrote: > > I have no idea what information is wanted. > > I am looking for descriptions about circumstances under which the > metavariable combination > will be useful by the mentioned SmPL conjunctions. I still don't understand the question. Another

Re: [Cocci] Addition of support for conjunctions on types

2017-08-28 Thread SF Markus Elfring
>> I would like to know a bit more for the application of such a metavariable >> combination. I would appreciate another feedback for this aspect. >> Unfortunately, I get the information “… Fatal error occurred, no output PDF >> file produced! …” from data processing by the command “make

Re: [Cocci] Automatic replacement of function declarations

2017-08-28 Thread Kees Cook
On Mon, Aug 28, 2017 at 4:34 AM, Julia Lawall wrote: > > > On Sun, 27 Aug 2017, Kees Cook wrote: > >> Hi, >> >> So, I noticed that if I replace argument types in a function, >> coccinelle will normally replace them in any forward declarations too. >> However, this: >> >>

Re: [Cocci] Addition of support for conjunctions on types

2017-08-28 Thread SF Markus Elfring
> @@ > type t; > identifier i; > @@ > > ( > struct i > & > t > ) > > will now bind both i and t appropriately. I would like to know a bit more for the application of such a metavariable combination. I hoped also to read something about it in the current manual. Unfortunately, I get the

Re: [Cocci] Addition of support for conjunctions on types

2017-08-28 Thread SF Markus Elfring
> I have no idea what information is wanted. I am looking for descriptions about circumstances under which the metavariable combination will be useful by the mentioned SmPL conjunctions. Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] Addition of support for conjunctions on types

2017-08-28 Thread SF Markus Elfring
>> I am looking for descriptions about circumstances under which the >> metavariable combination >> will be useful by the mentioned SmPL conjunctions. > > I still don't understand the question. It seems that I have got a few understanding difficulties with the added functionality. > Another

[Cocci] cocci: remove unnecessary casts of void * while avoiding casts with __user or __force ?

2017-08-28 Thread Joe Perches
A simple cocci script that removes unnecessary casts of a void * will also remove casts with __force or __user e.g.: -   xemaclite_aligned_write(address_ptr, (u32 __force *) addr, ETH_ALEN); +   xemaclite_aligned_write(address_ptr, addr, ETH_ALEN); Is there a simple mechanism to avoid

Re: [Cocci] cocci: remove unnecessary casts of void * while avoiding casts with __user or __force ?

2017-08-28 Thread Julia Lawall
On Mon, 28 Aug 2017, Joe Perches wrote: > A simple cocci script that removes unnecessary casts of > a void * will also remove casts with __force or __user Unfortunately, attributes are currently not supported inside casts. This can be done in a hackish way (possible false negatives) as