Coccinelle archive on lore.kernel.org
 help / Atom feed
* [Cocci] Blank space in front of function definition name confuses spatch
@ 2019-01-22 22:30 Timur Tabi
  2019-01-23  6:19 ` Julia Lawall
  2019-01-24 20:19 ` Julia Lawall
  0 siblings, 2 replies; 4+ messages in thread
From: Timur Tabi @ 2019-01-22 22:30 UTC (permalink / raw)
  To: cocci

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

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 #2: nv_printf.cocci --]
[-- Type: application/octet-stream, Size: 8527 bytes --]

[-- Attachment #3: test.c --]
[-- Type: text/x-csrc, Size: 325 bytes --]

 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));
}

[-- Attachment #4: Type: text/plain, Size: 136 bytes --]

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cocci] Blank space in front of function definition name confuses spatch
  2019-01-22 22:30 [Cocci] Blank space in front of function definition name confuses spatch Timur Tabi
@ 2019-01-23  6:19 ` Julia Lawall
  2019-01-24 20:19 ` Julia Lawall
  1 sibling, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2019-01-23  6:19 UTC (permalink / raw)
  To: Timur Tabi; +Cc: cocci



On Tue, 22 Jan 2019, Timur Tabi wrote:

> 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:

The problem only comes when te return type is a typedef.  I will see if it
is possible to fix it.

julia

>
> 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: (
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cocci] Blank space in front of function definition name confuses spatch
  2019-01-22 22:30 [Cocci] Blank space in front of function definition name confuses spatch Timur Tabi
  2019-01-23  6:19 ` Julia Lawall
@ 2019-01-24 20:19 ` Julia Lawall
  2019-01-28 21:50   ` Timur Tabi
  1 sibling, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2019-01-24 20:19 UTC (permalink / raw)
  To: Timur Tabi; +Cc: cocci



On Tue, 22 Jan 2019, Timur Tabi wrote:

> 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: (

This should be fixed in the version on github.  Please try again.

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cocci] Blank space in front of function definition name confuses spatch
  2019-01-24 20:19 ` Julia Lawall
@ 2019-01-28 21:50   ` Timur Tabi
  0 siblings, 0 replies; 4+ messages in thread
From: Timur Tabi @ 2019-01-28 21:50 UTC (permalink / raw)
  To: Julia Lawall; +Cc: cocci

On Thu, Jan 24, 2019 at 2:20 PM Julia Lawall <julia.lawall@lip6.fr> wrote:
>
> This should be fixed in the version on github.  Please try again.

Yes, it works, thanks.
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 22:30 [Cocci] Blank space in front of function definition name confuses spatch Timur Tabi
2019-01-23  6:19 ` Julia Lawall
2019-01-24 20:19 ` Julia Lawall
2019-01-28 21:50   ` Timur Tabi

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr cocci@archiver.kernel.org
	public-inbox-index cocci


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/ public-inbox