On Fri, Jan 12, 2018 at 7:50 PM, Julia Lawall <[email protected]> wrote:
>
> Is it possible to parse the macro? That is, is the body a legal C
> statement or expression?

The macro I was looking at is module_usb_serial_driver():

https://elixir.free-electrons.com/linux/v4.15-rc7/source/include/linux/usb/serial.h#L433

The macro itself expands to another macro (maybe that is the
problem?), which expands to a few C function definitions. In this case
I was interested in seeing whether a file used the
"usb_serial_register_drivers()" function, which is called in one of
those function definitions.

Thanks,
Martijn

>
>
> Normally, macros are only unfolded when doing so is necessary to parse the
> context in which the macro occurs.  But when a macro is unfolded for that
> reason, it is not possible to transform the unfolded code, although it is
> possible to match it.
>
> It is indeed possible that the --preprocess argument does not do anything.
>
> julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to