git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH] Makefile: create externcheck target

From
Denton Liu <liu.denton@gmail.com>
Date
Oct 8, 2020, 09:52 UTC
Message-ID
<20201008095233.GA2611970@generichostname>
In-Reply-To
<nycvar.QRO.7.76.6.2010081125390.50@tvgsbejvaqbjf.bet>
Hi Dscho,
On Thu, Oct 08, 2020 at 11:32:03AM +0200, Johannes Schindelin wrote:
> P.S.: I am not really certain that the `\s` is portable, I do not see any
> mention of it in
> https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_03
> and would therefore expect BSD sed not to handle this correctly.

I've run a varation of this on MacOS's sed before and it works. Unfortunately, I don't have access to a MacOS machine anymore so I can't 100% confirm it.

Show 5 quoted lines
> In any
> case, the `-i` is _not_ portable, as BSD sed takes a mandatory argument
> (see
> https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux
> for more details).

This was the main reason why I sent it out as an RFC (although I forgot to mention it in the commit message, whoops). Perhaps we could write this as

	externcheck: $(filter-out $(THIRD_PARTY_SOURCES),$(filter %.c %.h,$(shell $(FIND_SOURCE_FILES))))
		sed -i.bak 's/^\(\s*\)extern \([^(]*([^*]\)/\1\2/' $^
		$(RM) $(addsuffix .bak,$^)

instead? I think that since this is a developer target, we can probably call this portable enough.

Thanks, Denton

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 5 of 7 in “compat/mingw.h: drop extern from function declaration”
  1. compat/mingw.h: drop extern from function declarationDenton Liu, Oct 7, 2020
  2. Johannes SchindelinOct 7, 2020
  3. Makefile: create externcheck targetDenton Liu, Oct 8, 2020
  4. Johannes SchindelinOct 8, 2020
  5. Denton LiuOct 8, 2020
  6. Johannes SchindelinOct 8, 2020
  7. Junio C HamanoOct 9, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.