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

Reply via email to