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

Re: [PATCH] convert: mark a file-local symbol static

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Oct 17, 2016, 17:15 UTC
Message-ID
<c2d5d79d-bb00-6833-28ae-bb707ffd2fa1@ramsayjones.plus.com>
In-Reply-To
<20161017021825.jgpsew7qqfjrirhw@sigill.intra.peff.net>
On 17/10/16 03:18, Jeff King wrote:
Show 16 quoted lines
> On Mon, Oct 17, 2016 at 02:37:58AM +0100, Ramsay Jones wrote:
> 
>> Hmm, well, you have to remember that 'make clean' sometimes
>> doesn't make clean. Ever since the Makefile was changed to only
>> remove $(OBJECTS), rather than *.o xdiff/*.o etc., you have to
>> remember to 'make clean' _before_ you switch branches. Otherwise,
>> you risk leaving some objects laying around. Since the script
>> runs 'nm' on all objects it finds, any stale ones can cause problems.
>> (Of course, I almost always forget, so I frequently have to manually
>> check for and remove stale objects!)
> 
> Gross. I would not be opposed to a Makefile rule that outputs the
> correct set of OBJECTS so this (or other) scripts could build on it.
> 
> IIRC, BSD make has an option to do this "make -V OBJECTS" or something,
> but I don't thnk there's an easy way to do so.

Hmm, I would go in the opposite direction and take a leaf out of Ævar's book (see commit bc548efe) and this one-liner:

diff --git a/Makefile b/Makefile
index ee89c06..c08c25e 100644
--- a/Makefile
+++ b/Makefile
@@ -2506,7 +2506,7 @@ profile-clean:
 
 clean: profile-clean coverage-clean
        $(RM) *.res
-       $(RM) $(OBJECTS)
+       $(RM) $(addsuffix *.o,$(object_dirs))
        $(RM) $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
        $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
        $(RM) $(TEST_PROGRAMS) $(NO_INSTALL)

This would actually solve my problem, but it actually isn't a
_complete_ solution. (Hint: think about what isn't in $(OBJECTS),
depending on the configuration). ;-)

> Or, since it seems to find useful results quite frequently, maybe it
> would be worth including the script inside git (and triggering it with
> an optional Makefile rule). It sounds like we'd need a way to annotate
> known false positives, but if it were in common use, it would be easier
> to get people to keep that list up to date.

Hmm, I suspect that wouldn't happen, which would reduce it usefulness
and ultimately lead to it not being used. (Updating the 'stop list' would
fast become a burden.)

I find it useful to flag these issues automatically, but I still need
to look at each symbol and decide what to do (you may not agree with
some of my choices either - take a look at the output on the master
branch!).

The way I use it, I effectively ignore the 'stop list' maintenance issues.

ATB,
Ramsay Jones
Previous: Ramsay Jones
Message 14 of 14 in “convert: mark a file-local symbol static”
  1. convert: mark a file-local symbol staticRamsay Jones, Oct 11, 2016
  2. Lars SchneiderOct 15, 2016
  3. Ramsay JonesOct 15, 2016
  4. Lars SchneiderOct 16, 2016
  5. Ramsay JonesOct 17, 2016
  6. Jeff KingOct 17, 2016
  7. Johannes SchindelinOct 17, 2016
  8. Jeff KingOct 17, 2016
  9. Ramsay JonesOct 17, 2016
  10. Junio C HamanoOct 17, 2016
  11. René ScharfeOct 17, 2016
  12. Stefan BellerOct 17, 2016
  13. Ramsay JonesOct 17, 2016
  14. Ramsay JonesOct 17, 2016

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.