From mboxrd@z Thu Jan 1 00:00:00 1970 From: a.hajda@samsung.com (Andrzej Hajda) Date: Tue, 22 Sep 2015 15:09:41 +0200 Subject: [Cocci] [PATCH] Coccinelle: remove incorrect -include option transformation In-Reply-To: References: <1442926130-17817-1-git-send-email-a.hajda@samsung.com> Message-ID: <56015315.507@samsung.com> To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr On 09/22/2015 02:58 PM, Julia Lawall wrote: > > On Tue, 22 Sep 2015, Andrzej Hajda wrote: > >> 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 >> --- >> scripts/coccicheck | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/scripts/coccicheck b/scripts/coccicheck >> index bbf901a..6d84b05 100755 >> --- a/scripts/coccicheck >> +++ b/scripts/coccicheck >> @@ -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. 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 > > julia > > >> if [ "$C" = "1" -o "$C" = "2" ]; then >> ONLINE=1 >> -- >> 1.9.1 >> >> From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933416AbbIVNKI (ORCPT ); Tue, 22 Sep 2015 09:10:08 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:26284 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932636AbbIVNKG (ORCPT ); Tue, 22 Sep 2015 09:10:06 -0400 X-AuditID: cbfec7f5-f794b6d000001495-b3-5601532b6bfc Subject: Re: [PATCH] Coccinelle: remove incorrect -include option transformation To: Julia Lawall References: <1442926130-17817-1-git-send-email-a.hajda@samsung.com> Cc: linux-kernel@vger.kernel.org, Bartlomiej Zolnierkiewicz , Marek Szyprowski , Gilles Muller , Nicolas Palix , Michal Marek , "moderated list:COCCINELLE/Semantic Patches (SmPL)" From: Andrzej Hajda Message-id: <56015315.507@samsung.com> Date: Tue, 22 Sep 2015 15:09:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRmVeSWpSXmKPExsVy+t/xa7rawYxhBj1buC02zljPavFj02o2 i9k/LzFZLHtwmtHi8q45bBZrj9xlt5jTOovN4tjL5UwOHB7HjrUye+zdkuXRt2UVo8f6LVdZ PB4tu8/i8XmTXABbFJdNSmpOZllqkb5dAlfGme+6BXt4K2b3LWBrYHzE1cXIySEhYCIx53YL C4QtJnHh3no2EFtIYCmjxNYX9V2MXED2c0aJwz/mMIIkhAUCJM6s7mPtYuTgEBFQl+j9kAtR XyRxatppNpB6ZoETTBKr5jUxgyTYBDQl/m6+CTaUV0BNYmvPMbBlLAKqEqenbGYCsUUFIiRO nX0LVSMo8WPyPRaQ+ZwClhIHJ8eCmMwCehL3L2qBVDALyEtsXvOWeQKjwCwkDbMQqmYhqVrA yLyKUTS1NLmgOCk910ivODG3uDQvXS85P3cTIyTcv+5gXHrM6hCjAAejEg+vRx9DmBBrYllx Ze4hRgkOZiUR3nWKjGFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeWfueh8iJJCeWJKanZpakFoE k2Xi4JRqYJw7ffJHbaWQrm0hQeYeD7Ysj1l2c3br1IfMNy/9Fv2Ra9B1OueGZfDWbwbLWA9b LTOdfPVreN4kpqU/D9WbG5zPSVPNqON6/UbW5cGdDSFcL6z3O7ndW8zk0m9cn3Fd+DnDpBPX TK99iApNtuTaL5QUtUr24yfxE7EcN+aclXcVuTXB7avpb08lluKMREMt5qLiRACqh+g4cwIA AA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/22/2015 02:58 PM, Julia Lawall wrote: > > On Tue, 22 Sep 2015, Andrzej Hajda wrote: > >> 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 >> --- >> scripts/coccicheck | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/scripts/coccicheck b/scripts/coccicheck >> index bbf901a..6d84b05 100755 >> --- a/scripts/coccicheck >> +++ b/scripts/coccicheck >> @@ -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. 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 > > julia > > >> if [ "$C" = "1" -o "$C" = "2" ]; then >> ONLINE=1 >> -- >> 1.9.1 >> >>