2 \section{Tips and Tricks
}
4 \subsection{How to remove useless parentheses?
}
6 If you want to rewrite any access to a pointer value by a function
7 call, you may use the following semantic patch.
9 \begin{lstlisting
}[language=Cocci
]
14 However, if for some reason your code looks like
\verb|bar = *(foo)|,
15 you will end up with
\verb|bar = readb((foo))| as the extra
16 parentheses around
\texttt{foo
} are capture by the metavariable
19 In order to generate better output code, you can use the following
20 semantic patch instead.
21 \begin{lstlisting
}[language=Cocci
]
27 And rely on your standard.iso isomorphism file which should contain:
28 \begin{lstlisting
}[language=Cocci
]
37 Coccinelle will then consider
\verb|bar = *(foo)| as equivalent to
38 \verb|bar = *foo| (but not the other way around) and capture both.
39 Finally, it will generate
\verb|bar = readb(foo)| as expected.
43 %%% TeX-master: "cocci_syntax"
46 %%% ispell-local-dictionary: "american"