If I have a blank space in front of the return parameter and function
name, spatch gets confused and rejects the file.  I've attached a
test.c and my nv_printf.cocci.  If I remove the blank space before
"NV_STATUS" and "mycrazyfunc", everything works.  But with the blank
space, it causes this error:

ERROR-RECOV: found sync '}' at line 14
parsing pass2: try again
ERROR-RECOV: found sync '}' at line 14
parsing pass3: try again
ERROR-RECOV: found sync '}' at line 14
parse error
 = File "/home/ttabi/test.c", line 1, column 1, charpos = 1
  around = 'NV_STATUS',
  whole content =  NV_STATUS
badcount: 13
BAD:!!!!!  NV_STATUS
bad:  mycrazyfunc
bad: (

Attachment: nv_printf.cocci
Description: Binary data

 NV_STATUS
 mycrazyfunc
(
    POBJGPU pLocalGpu,
    POBJBUS pLocalBus
)
{
        DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
                    "NVRM: %s: this is a test \
                    of multiline " NvP64_fmt " strings %p\n ",
                    __FUNCTION__,
                    p1,
                    p2));
}
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to