On Tue, 5 Apr 2011, Jani Monoses wrote:
> What is the most straightforward way of commenting out blocks of the form:
>
>
> startBlock();
> operation1();
> ...
> operationn();
> endBlock();
>
> where startBlock()/endBlock() are the markers by putting them fully within an
> #ifdef 0/#endif pair? (/* */ pair works too, but ifdef is better so it can be
> made conditional)
>
> I found I cannot use #ifdef as an added line in a patch, and no examples that
> do something similar. If there's such an example somewhere I'd appreciate a
> link.
The following worked fine for me:
@@
@@
+ #ifdef 0
foo();
...
bar();
+ #endif
int main () {
one();
foo();
one();
one();
bar();
one();
}
The only problem is that for some reason the #ifdef and the #endif are
indented. It is supposed to know that they should stay in the leftmost
column.
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)