Re: thoughts wanted on dead code hunting?
From: Kees Cook
Date: Wed May 15 2024 - 23:25:33 EST
On Thu, May 16, 2024 at 12:40:40AM +0000, Dr. David Alan Gilbert wrote:
> * Kees Cook (keescook@xxxxxxxxxxxx) wrote:
> > // Options: --recursive-includes
> > @find@
> > struct to_be_removed INSTANCE;
> > struct to_be_removed *POINTER;
Oops, I missed this line:
@@
> >
> > (
> > * INSTANCE
> > |
> > * POINTER
> > )
> >
> >
> > (I bet this could be improved, but it should be a usable example.)
>
> Hmm, now if I could use coccinelle it would be more tolerant of coding
> style and slight variations than my script.
> However, trying that tiny example, I get:
> File "play.cocci", line 10, column 1, charpos = 141
> around = '',
> whole content = )
>
> so it seems to be objecting to something at the end of the file?
Sorry, yes, missed the "@@" between the identifiers and the code pattern
to match.
--
Kees Cook