On Fri, 1 Jul 2011, Nicolas Palix wrote:
> On Fri, Jul 1, 2011 at 9:46 PM, Julia Lawall <[email protected]> wrote:
> > On Fri, 1 Jul 2011, Nicolas Palix wrote:
> >
> >> Hi,
> >>
> >> The following should work.
> >>
> >> @@
> >> @@
> >>
> >> +#include <foo.h>
> >> #include <...>
> >
> > That would add it before every include. Perhaps it is possible to put a
> > position variable somewhere on an include. I will check.
>
> That is what I was expecting but when applied to
>
> #include <first.h>
> #include <second.h>
> #include <third.h>
>
> void main() {
> }
>
> I got the following
>
> --- 1st_header.c 2011-07-01 21:34:02.805323547 +0200
> +++ /tmp/cocci-output-23061-cb581c-1st_header.c 2011-07-01
> 21:50:31.511432597 +0200
> @@ -1,3 +1,4 @@
> +#include <smthg.h>
> #include <first.h>
> #include <second.h>
> #include <third.h>
>
>
> There is thus maybe some hack for that...
Indeed, I think that that is the case. And if you put the + code
afterwards, I think it goes after the last one.
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)