Hi Markus,
I ended up with:
```
@@
type T;
expression source;
@@
- REQUIRE(((T *)source) != NULL);
+ REQUIRE(source != NULL);
@@
type T;
typedef dns_rdatacommon_t;
identifier common, rdtype;
identifier source;
@@
REQUIRE((
- (T *)source
+ (dns_rdatacommon_t *)source
)->
- common.
the rule fail.
Thanks,
Ondrej
--
Ondřej Surý
ond...@sury.org
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
@@
type T;
expression V, E1, E2;
@@
- V = (T)isc_mem_get(E1, E2);
+ V = isc_mem_get(E1, E2);
Thank you,
--
Ondřej Surý
ond...@sury.org
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
Hi Julia,
thanks for the quick response.
> On 1 Nov 2019, at 14:09, Julia Lawall wrote:
>
> This is not possible. ... describes control-flow paths. Nothing happens
> after a return. Your attempt above would match functions where all
> control-flow paths end with return (ISC_R_SUCCESS);,
Hi,
we changed our allocator (wrapper) function to assert() instead of returning
ISC_R_MEMORY.
As you can imagine there’s a lot of checks down the road that needs to be
cleaned up,
so I am looking for a way to detect function that only does:
isc_result_t
foo(…) {
…
return (ISC_R_SUCCESS);
}