Coccinelle: remove incorrect -include option transformation
PATCH 1/1 Coccinelle: remove incorrect -include option transformation
kbuild/gcc uses -include option to include files and -I to provide paths for #include <> directive. The same is true for spatch.
--- scripts/coccicheck | 1 - 1 file changed, 1 deletion(-)
scripts/coccicheck +0 -1
@@ -30,7 +30,6 @@ FLAGS="$SPFLAGS --very-quiet" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" COCCIINCLUDE=${LINUXINCLUDE//-I/-I } -COCCIINCLUDE=${COCCIINCLUDE//-include/-I} if [ "$C" = "1" -o "$C" = "2" ]; then ONLINE=1
Signature · 1 line
1.9.1
Quoted 13 lines · Andrzej Hajda
kbuild/gcc uses -include option to include files and -I to provide paths for #include <> directive. The same is true for spatch.
Signed-off-by Andrzej Hajda <[email protected]>--- scripts/coccicheck | 1 - 1 file changed, 1 deletion(-)scripts/coccicheck +0
-0
scripts/coccicheck FLAGS="$SPFLAGS --very-quiet" · line 33
Quoted 4 lines
scripts/coccicheck +0
-1@@ -30,7 +30,6 @@ FLAGS="$SPFLAGS --very-quiet" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" COCCIINCLUDE=${LINUXINCLUDE//-I/-I } -COCCIINCLUDE=${COCCIINCLUDE//-include/-I}
I'm not sure of the meaning of the above notation, nor what is the intention. Coccinelle does have a --include option, but it doesn't mean the same thing as -I. It is a way to have a file be included that is not included according to the normal inclusion strategy. For example, if a.h includes b.h which includes c.h, and if one considers that c.h is really important for having the right type information, but one doesn't want the cost of including everything via --recursive-includes, then one could put --include c.h.
julia
Quoted 7 lines
scripts/coccicheck +0
-1if [ "$C" = "1" -o "$C" = "2" ]; then ONLINE=1 --1.9.1
Quoted 20 lines · Julia Lawall
Quoted 13 lines · Andrzej Hajda
kbuild/gcc uses -include option to include files and -I to provide paths for #include <> directive. The same is true for spatch.
Signed-off-by Andrzej Hajda <[email protected]>--- scripts/coccicheck | 1 - 1 file changed, 1 deletion(-)scripts/coccicheck +0
-0scripts/coccicheck FLAGS="$SPFLAGS --very-quiet" · line 33
Quoted 4 lines
scripts/coccicheck +0
-1@@ -30,7 +30,6 @@ FLAGS="$SPFLAGS --very-quiet" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" COCCIINCLUDE=${LINUXINCLUDE//-I/-I } -COCCIINCLUDE=${COCCIINCLUDE//-include/-I}
Quoted 8 lines
I'm not sure of the meaning of the above notation, nor what is the intention. Coccinelle does have a --include option, but it doesn't mean the same thing as -I. It is a way to have a file be included that is not included according to the normal inclusion strategy. For example, if
a.hincludesb.hwhich includesc.h, and if one considers thatc.his really important for having the right type information, but one doesn't want the cost of including everything via --recursive-includes, then one could put --includec.h.
This option has the same meaning for gcc.
But the patch is incorrect. It should be:
COCCIINCLUDE=${COCCIINCLUDE// -include/ --include}
gcc option '-include' should be converted to spatch option '--include', ie one minus should be added.
Regards
Andrzej
Quoted 10 lines
julia
Quoted 6 lines
scripts/coccicheck +0
-1if [ "$C" = "1" -o "$C" = "2" ]; then ONLINE=1 --1.9.1
PATCH v2 1/1 Coccinelle: fix incorrect -include option transformation
kbuild/gcc uses -include option to include files and -I to provide paths for #include <> directive. In case of spatch latter option should be prefixed with two -.
--- scripts/coccicheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/coccicheck +1 -1
@@ -30,7 +30,7 @@ FLAGS="$SPFLAGS --very-quiet" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" COCCIINCLUDE=${LINUXINCLUDE//-I/-I } -COCCIINCLUDE=${COCCIINCLUDE//-include/-I} +COCCIINCLUDE=${COCCIINCLUDE// -include/ --include} if [ "$C" = "1" -o "$C" = "2" ]; then ONLINE=1
Signature · 1 line
1.9.1
Re: [PATCH v2] Coccinelle: fix incorrect -include option transformation
Quoted 3 lines · Andrzej Hajda
kbuild/gcc uses -include option to include files and -I to provide paths for #include <> directive. In case of spatch latter option should be prefixed with two -.
Thanks!
julia
Quoted 23 lines
Signed-off-by Andrzej Hajda <[email protected]>--- scripts/coccicheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/coccicheck +1
-2@@ -30,7 +30,7 @@ FLAGS="$SPFLAGS --very-quiet" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" COCCIINCLUDE=${LINUXINCLUDE//-I/-I } -COCCIINCLUDE=${COCCIINCLUDE//-include/-I} +COCCIINCLUDE=${COCCIINCLUDE// -include/ --include} if [ "$C" = "1" -o "$C" = "2" ]; then ONLINE=1 --1.9.1
Re: [PATCH v2] Coccinelle: fix incorrect -include option transformation
Dne 22.9.2015 v 15:27 Julia Lawall napsal(a):
Quoted 4 lines · Andrzej Hajda
Quoted 3 lines
kbuild/gcc uses -include option to include files and -I to provide paths for #include <> directive. In case of spatch latter option should be prefixed with
That hash sign in the comment was not nice :).
Quoted 3 lines
Quoted 1 line
two -.
Acked-by Julia Lawall <[email protected]
Applied to kbuild.git#misc.
Michal
Quoted 30 lines · Andrzej Hajda
Quoted 20 lines · Julia Lawall
Quoted 13 lines · Andrzej Hajda
kbuild/gcc uses -include option to include files and -I to provide paths for #include <> directive. The same is true for spatch.
Signed-off-by Andrzej Hajda <[email protected]>--- scripts/coccicheck | 1 - 1 file changed, 1 deletion(-)scripts/coccicheck +0
-0scripts/coccicheck FLAGS="$SPFLAGS --very-quiet" · line 33
Quoted 4 lines
scripts/coccicheck +0
-1@@ -30,7 +30,6 @@ FLAGS="$SPFLAGS --very-quiet" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" COCCIINCLUDE=${LINUXINCLUDE//-I/-I } -COCCIINCLUDE=${COCCIINCLUDE//-include/-I}Quoted 8 lines
I'm not sure of the meaning of the above notation, nor what is the intention. Coccinelle does have a --include option, but it doesn't mean the same thing as -I. It is a way to have a file be included that is not included according to the normal inclusion strategy. For example, if
a.hincludesb.hwhich includesc.h, and if one considers thatc.his really important for having the right type information, but one doesn't want the cost of including everything via --recursive-includes, then one could put --includec.h.
Quoted 7 lines
This option has the same meaning for gcc.
But the patch is incorrect. It should be:COCCIINCLUDE=${COCCIINCLUDE// -include/ --include}
gcc option '-include' should be converted to spatch option '--include', ie one minus should be added.
OK, do you want to submit a patch for that?
thanks,
julia
Quoted 17 lines
Regards
AndrzejQuoted 10 lines
julia
Quoted 6 lines
scripts/coccicheck +0
-1if [ "$C" = "1" -o "$C" = "2" ]; then ONLINE=1 --1.9.1
Quoted 2 lines · Andrzej Hajda
kbuild/gcc uses -include option to include files and -I to provide paths for #include <> directive. The same is true for spatch.
Nicolas, if you think this is OK, please ack it.
thanks,
julia
Quoted 21 lines
Signed-off-by Andrzej Hajda <[email protected]>--- scripts/coccicheck | 1 - 1 file changed, 1 deletion(-)scripts/coccicheck +0
-2@@ -30,7 +30,6 @@ FLAGS="$SPFLAGS --very-quiet" # spatch only allows include directories with the syntax "-I include" # while gcc also allows "-Iinclude" and "-include include" COCCIINCLUDE=${LINUXINCLUDE//-I/-I } -COCCIINCLUDE=${COCCIINCLUDE//-include/-I} if [ "$C" = "1" -o "$C" = "2" ]; then ONLINE=1 --1.9.1