linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow to check mdadm with clangs static checker (scan-build)
@ 2014-01-20 16:14 Bernd Schubert
  2014-01-20 23:06 ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: Bernd Schubert @ 2014-01-20 16:14 UTC (permalink / raw)
  To: Linux RAID Mailing List, NeilBrown

Clangs scan-build tool (static checker) set the environmental variable CC,
so Makefile should allow to use that value.

Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 043bcea..63cc3ac 100644
--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,7 @@ KLIBC=/home/src/klibc/klibc-0.77
 
 KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
 
-CC = $(CROSS_COMPILE)gcc
+CC ?= $(CROSS_COMPILE)gcc
 CXFLAGS ?= -ggdb
 CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
 ifdef WARN_UNUSED

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Allow to check mdadm with clangs static checker (scan-build)
  2014-01-20 16:14 [PATCH] Allow to check mdadm with clangs static checker (scan-build) Bernd Schubert
@ 2014-01-20 23:06 ` NeilBrown
  2014-01-21 17:39   ` Bernd Schubert
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2014-01-20 23:06 UTC (permalink / raw)
  To: Bernd Schubert; +Cc: Linux RAID Mailing List

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

On Mon, 20 Jan 2014 17:14:12 +0100 Bernd Schubert
<bernd.schubert@fastmail.fm> wrote:

> Clangs scan-build tool (static checker) set the environmental variable CC,
> so Makefile should allow to use that value.
> 
> Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
> ---
>  Makefile |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 043bcea..63cc3ac 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -41,7 +41,7 @@ KLIBC=/home/src/klibc/klibc-0.77
>  
>  KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
>  
> -CC = $(CROSS_COMPILE)gcc
> +CC ?= $(CROSS_COMPILE)gcc
>  CXFLAGS ?= -ggdb
>  CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
>  ifdef WARN_UNUSED

I'm not exactly against this, but presumably you could tell scan-build to run

  make CC=$CC

to achieve the same effect with no patch ??

i.e.

  scan-build 'make CC=$CC'

But maybe I'll apply it anyway.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Allow to check mdadm with clangs static checker (scan-build)
  2014-01-20 23:06 ` NeilBrown
@ 2014-01-21 17:39   ` Bernd Schubert
  0 siblings, 0 replies; 3+ messages in thread
From: Bernd Schubert @ 2014-01-21 17:39 UTC (permalink / raw)
  To: NeilBrown; +Cc: Linux RAID Mailing List

On 01/21/2014 12:06 AM, NeilBrown wrote:
> On Mon, 20 Jan 2014 17:14:12 +0100 Bernd Schubert
> <bernd.schubert@fastmail.fm> wrote:
>
>> Clangs scan-build tool (static checker) set the environmental variable CC,
>> so Makefile should allow to use that value.
>>
>> Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
>> ---
>>   Makefile |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 043bcea..63cc3ac 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -41,7 +41,7 @@ KLIBC=/home/src/klibc/klibc-0.77
>>
>>   KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
>>
>> -CC = $(CROSS_COMPILE)gcc
>> +CC ?= $(CROSS_COMPILE)gcc
>>   CXFLAGS ?= -ggdb
>>   CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
>>   ifdef WARN_UNUSED
>
> I'm not exactly against this, but presumably you could tell scan-build to run
>
>    make CC=$CC
>
> to achieve the same effect with no patch ??
>
> i.e.
>
>    scan-build 'make CC=$CC'

Yeah, that would also work. IMHO, it is just not very intuitive.
Maybe I should submit a patch for the man page of the debian package and 
upstream docs.

>
> But maybe I'll apply it anyway.

Would be great.


Thanks,
Bernd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-21 17:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20 16:14 [PATCH] Allow to check mdadm with clangs static checker (scan-build) Bernd Schubert
2014-01-20 23:06 ` NeilBrown
2014-01-21 17:39   ` Bernd Schubert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).