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

Re: [PATCH] very small cleanup: #undef a macro that isn't used anywhere else

From
FGFrancis Galiegue <fg@one2team.net>
Date
Nov 10, 2008, 19:09 UTC
Message-ID
<200811102009.58332.fg@one2team.net>
In-Reply-To
<alpine.DEB.1.00.0811102008330.30769@pacific.mpi-cbg.de>
Le Monday 10 November 2008 20:09:21 Johannes Schindelin, vous avez écrit :
Show 10 quoted lines
> Hi,
>
> On Mon, 10 Nov 2008, Francis Galiegue wrote:
> > In xdiff-interface.c, the FIRST_FEW_BYTES macro is defined, is never
> > used anwhere else, so we might as well undefine it after we're done with
> > it.
>
> Would not the consequence be that we end up with a ton of #undefines all
> over the place, reducing readability incredibly?
>
Hmwell, this is a twofold argument, I guess...
* for: the macro is defined, not undefined: it means that potentially, it can 
be used somewhere else in the file; but it isn't (in this case);
* against: macros defined in a C file only ever have scope in said file 
(unless so mischievous Makefile cats two C files together before compile and 
file order is important -- but git doesn't do that), so why #undefine 
anything?
Personally, I'm with the first argument. YMMV, of course.
-- 
fge
Previous: Johannes Schindelin
Message 3 of 3 in “very small cleanup: #undef a macro that isn't used anywhere else”
  1. very small cleanup: #undef a macro that isn't used anywhere elseFrancis Galiegue, Nov 10, 2008
  2. Johannes SchindelinNov 10, 2008
  3. Francis GaliegueNov 10, 2008

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.