Re: [PATCH v3 0/4] remove extern from function declarations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 01, 2019 at 06:01:08AM -0400, Denton Liu wrote:
> > Is it not possible to exclude certain directories for certain semantic
> > patches?
> > 
> > I guess we could also simply declare that *all* Coccinelle patches should
> > leave `compat/` alone, on the basis that those files are likely coming
> > from some sort of upstream. But then, `compat/mingw.c` and `compat/win32/`
> > seem not to fall into that category...
> > 
> > Ciao,
> > Dscho
> 
> Deciding whether this is a good idea is above my paygrade ;)
>
> However, if this is a good idea, we could use this patch to make it
> happen:
> 
> -- >8 --
> Subject: [PATCH] Makefile: filter out compat/ from coccicheck
> 
> Since most files in compat/ are pulled from external sources, ensure
> that they do not get modified when we run coccicheck because we do not
> want them to differ from upstream as much as possible.
> 
> Make exceptions for mingw.c and win32/*.c as these are files that we
> have created and not pulled from upstream.

I'm not sure that we really need these exceptions.

C_SOURCES comes from C_OBJ, i.e. it is basically all '*.c' source
files that we compile, taking the platform and Makefile knobs into
account.  On Linux we don't compile 'compat/mingw.c' and
'compat/win32/*.c', so when running 'make coccicheck' on Linux it
won't look into these source files anyway, so we don't need these
exceptions.  On Windows, however...  well, is it even possible to
build and run Coccinelle on Windows in the first place, with all its
OCaml dependencies?!  If not, then these exceptions won't do any good.

Anyway, if we do want these exceptions, then what about
'compat/win32mmap.c' and 'compat/winansi.c'?  They look like "ours" as
well.


FWIW, out of curiosity I've run 'make coccicheck' on Linux with
'compat/mingw.c' and its friends explicitly added to C_SOURCES, and it
seems to work...  it even found two places in 'mingw.c' where
COPY_ARRAY could replace memcpy() :)


> Signed-off-by: Denton Liu <liu.denton@xxxxxxxxx>
> ---
>  Makefile | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 9f1b6e8926..b083c038c3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2782,11 +2782,14 @@ check: command-list.h
>  	fi
>  
>  C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
> +COCCI_COMPAT_SOURCES = $(addprefix compat/,mingw.c win32/%)


>  ifdef DC_SHA1_SUBMODULE
> -COCCI_SOURCES = $(filter-out sha1collisiondetection/%,$(C_SOURCES))
> +COCCI_SOURCES := $(filter-out sha1collisiondetection/%,$(C_SOURCES))
>  else
> -COCCI_SOURCES = $(filter-out sha1dc/%,$(C_SOURCES))
> +COCCI_SOURCES := $(filter-out sha1dc/%,$(C_SOURCES))
>  endif
> +COCCI_SOURCES := $(filter-out compat/%,$(COCCI_SOURCES))
> +COCCI_SOURCES += $(filter $(COCCI_COMPAT_SOURCES),$(C_SOURCES))
>  
>  %.cocci.patch: %.cocci $(COCCI_SOURCES)
>  	@echo '    ' SPATCH $<; \
> -- 
> 2.21.0.1033.g0e8cc1100c
> 



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux