Skip to contentSkip to conversation

Finding all uses of a flag define

Cocci Michael McConville 2 participants 4 messages Sep 29, 2015

lore
Share & tools
lore
#0 lore raw

This is probably a simple question. I'm trying to find all uses of the preproc define M_WAITOK used in the second argument of malloc() or mallocarray(). It may be or'd with other flags in any order.

A relevant example would be enough.

Thanks,
Michael

#1 lore raw
Quoted 3 lines · Michael McConville

This is probably a simple question. I'm trying to find all uses of the preproc define M_WAITOK used in the second argument of malloc() or mallocarray(). It may be or'd with other flags in any order.

malloc(e1, M_WAITOK | ...)

julia

Quoted 10 lines

A relevant example would be enough.

Thanks,
Michael
_______________________________________________
Cocci mailing list
Cocci at systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

#2 lore raw
Quoted 6 lines · Julia Lawall
Quoted 3 lines · Michael McConville

This is probably a simple question. I'm trying to find all uses of the preproc define M_WAITOK used in the second argument of malloc() or mallocarray(). It may be or'd with other flags in any order.

malloc(e1, M_WAITOK | ...)

Right, thanks. I was trying to get too fancy by using a disjunction. I'll just make separate rules for malloc and mallocarray.

#3 lore raw
Quoted 10 lines · Michael McConville
Quoted 6 lines · Julia Lawall
Quoted 3 lines · Michael McConville

This is probably a simple question. I'm trying to find all uses of the preproc define M_WAITOK used in the second argument of malloc() or mallocarray(). It may be or'd with other flags in any order.

malloc(e1, M_WAITOK | ...)

Right, thanks. I was trying to get too fancy by using a disjunction. I'll just make separate rules for malloc and mallocarray.

Disjunction should be ok too.

julia