Skip to contentSkip to conversation

might be bug report, breaking up of a comment

Cocci Robert Larice 2 participants 6 messages Feb 17, 2018 – Mar 12, 2018

lore
Share & tools
lore
#0 lore raw

Hello,

attached is a small example which seems to
break up a comment line,
thus commenting out following lines.

Please look at the "long reuse" line
which will have an open comment when spatch is run, thus commenting out the following "struct line *options"

Best Regards,
Robert Larice

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ex5.cocci
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20180217/689ecef7/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex5.c
Type: text/x-csrc
Size: 299 bytes
Desc: not available
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20180217/689ecef7/attachment.bin>

#1 lore raw
Quoted 9 lines · Robert Larice

Hello,

attached is a small example which seems to
break up a comment line,
thus commenting out following lines.

Please look at the "long reuse" line
which will have an open comment when spatch is run, thus commenting out the following "struct line *options"

I also see this undesriable behavior. Thanks for the report.

julia

#2 lore raw
Quoted 8 lines · Julia Lawall
Quoted 6 lines · Robert Larice

Hello,

attached is a small example which seems to
break up a comment line,
thus commenting out following lines.

Quoted 7 lines
Quoted 3 lines

Please look at the "long reuse" line
which will have an open comment when spatch is run, thus commenting out the following "struct line *options"

I also see this undesriable behavior. Thanks for the report.

julia

grepping a bit in the source code I found this:
cpp_eat_until_nl
perhaps in the vicinity of the issue.

and there is this comment somewhere:

(* cpp recognize C comments, so when #define xx (yy) /* comment \n ... */
* then he has already erased the /* comment. So:
* - dont eat the start of the comment otherwise afterwards we are in the middle
* of a comment and so will problably get a parse error somewhere.
* - have to recognize comments in cpp_eat_until_nl.
*)

#3 lore raw
Quoted 22 lines · Robert Larice
Quoted 8 lines · Julia Lawall
Quoted 6 lines · Robert Larice

Hello,

attached is a small example which seems to
break up a comment line,
thus commenting out following lines.

Quoted 7 lines
Quoted 3 lines

Please look at the "long reuse" line
which will have an open comment when spatch is run, thus commenting out the following "struct line *options"

I also see this undesriable behavior. Thanks for the report.

julia

grepping a bit in the source code I found this:
cpp_eat_until_nl
perhaps in the vicinity of the issue.

Quoted 8 lines

and there is this comment somewhere:

(* cpp recognize C comments, so when #define xx (yy) /* comment \n ... */
* then he has already erased the /* comment. So:
* - dont eat the start of the comment otherwise afterwards we are in the middle
* of a comment and so will problably get a parse error somewhere.
* - have to recognize comments in cpp_eat_until_nl.
*)

Thanks for the help, but that's not it at all. The problem is in the function get_indent in the file parsing_c/unparse_c.ml. I'll try to fix it tomorrow.

julia

#4 lore raw
In reply to Robert Larice
Quoted 22 lines · Robert Larice
Quoted 8 lines · Julia Lawall
Quoted 6 lines · Robert Larice

Hello,

attached is a small example which seems to
break up a comment line,
thus commenting out following lines.

Quoted 7 lines
Quoted 3 lines

Please look at the "long reuse" line
which will have an open comment when spatch is run, thus commenting out the following "struct line *options"

I also see this undesriable behavior. Thanks for the report.

julia

grepping a bit in the source code I found this:
cpp_eat_until_nl
perhaps in the vicinity of the issue.

Quoted 8 lines

and there is this comment somewhere:

(* cpp recognize C comments, so when #define xx (yy) /* comment \n ... */
* then he has already erased the /* comment. So:
* - dont eat the start of the comment otherwise afterwards we are in the middle
* of a comment and so will problably get a parse error somewhere.
* - have to recognize comments in cpp_eat_until_nl.
*)

The problem is fixed now.

julia

#5 lore raw
Quoted 3 lines · Julia Lawall

The problem is fixed now.

julia

Thank You !