On Fri, 12 Oct 2018, Timur Tabi wrote:
> I've attached a test.c and nv_printf.cocci file that demonstrates the problem.
>
> It appears that Coccinelle sometimes cannot handle multi-line string
> literals that are syntactically correct but still improper. For
> example:
>
> DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
> "NVRM: %s: this is a test \
> of multiline " NvP64_fmt " strings %p\n",
> __FUNCTION__,
> p1,
> p2));
>
> This is valid C, but technically the string literal should have
> quotation marks at the beginning of each line. When Coccinelle
> attempts to process my script with this, it gets confused and mangles
> the parameters after the string literal:
>
> void func(void)
> {
> - DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
> - "NVRM: %s: this is a test \
> - of multiline " NvP64_fmt " strings %p\n",
> - __FUNCTION__,
> - p1,
> - p2));
> -}
> + NV_PRINTF(DBG_LEVEL_ERRORS, "NVRM: %s: this is a test \
> + of multiline " NvP64_fmt " strings %p\n", __FUNCTION__,
> + of multiline "p1, p2);
> +}"
This problem has been fixed. Actually, it thought that " of multiline " was
the new amount to indent...
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
- [Cocci] Problem with improper multi-line string literals Timur Tabi
- Re: [Cocci] Problem with improper multi-line string lite... Julia Lawall
- Re: [Cocci] Problem with improper multi-line string ... Timur Tabi
- Re: [Cocci] Problem with improper multi-line str... Timur Tabi
- Re: [Cocci] Problem with improper multi-line... Timur Tabi
- Re: [Cocci] Problem with improper multi... Timur Tabi
- Re: [Cocci] Problem with improper m... Julia Lawall
- Re: [Cocci] Problem with improper multi-line str... Timur Tabi
- Re: [Cocci] Problem with improper multi-line string lite... Julia Lawall
- Re: [Cocci] Problem with improper multi-line string ... Timur Tabi
- Re: [Cocci] Problem with improper multi-line str... Julia Lawall
- Re: [Cocci] Problem with improper multi-line... Timur Tabi
- Re: [Cocci] Problem with improper multi... Julia Lawall
- Re: [Cocci] Problem with improper m... Timur Tabi
- Re: [Cocci] Problem with improper multi-line str... Himanshu Jha
- Re: [Cocci] Problem with improper multi-line... Julia Lawall
- Re: [Cocci] Problem with improper multi-line... Timur Tabi
- Re: [Cocci] Problem with improper multi... Julia Lawall
- Re: [Cocci] Problem with improper m... Timur Tabi
