[cfe-dev] [PATCH] scan-build: fix arguments for make and gmake

Anna Zaks ganna at apple.com
Mon Jun 24 11:12:30 PDT 2013


Looks good. Please, commit. 

Thanks for fixing!
Anna.
On Jun 21, 2013, at 4:45 AM, Andrey Vagin <avagin at openvz.org> wrote:

> CC and CCX must be set not only for the IgnoreErrors case.
> 
> This patch fixes a case when CC is defined in Makefile, because
> a value form the environment variable has smaller priority than makefile
> definition.
> 
> """
> The priority of assignments is from least binding to most binding; the
> * precedence of assignments is:
> * internal definitions
> * environment
> * makefile(s)
> * command line
> """
> 
> This bug was found by Roman Kagan <rkagan at parallels.com>.
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
> tools/scan-build/scan-build | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/scan-build/scan-build b/tools/scan-build/scan-build
> index 22d5289..cb79903 100755
> --- a/tools/scan-build/scan-build
> +++ b/tools/scan-build/scan-build
> @@ -1017,10 +1017,10 @@ sub RunBuildCommand {
>     shift @$Args;
>     unshift @$Args, $CXXAnalyzer;
>   }
> -  elsif ($IgnoreErrors) {
> -    if ($Cmd eq "make" or $Cmd eq "gmake") {
> -      AddIfNotPresent($Args, "CC=$CCAnalyzer");
> -      AddIfNotPresent($Args, "CXX=$CXXAnalyzer");
> +  elsif ($Cmd eq "make" or $Cmd eq "gmake") {
> +    AddIfNotPresent($Args, "CC=$CCAnalyzer");
> +    AddIfNotPresent($Args, "CXX=$CXXAnalyzer");
> +    if ($IgnoreErrors) {
>       AddIfNotPresent($Args,"-k");
>       AddIfNotPresent($Args,"-i");
>     }
> -- 
> 1.8.2.1
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130624/6d93d75a/attachment.html>


More information about the cfe-dev mailing list