Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2006:
[Freeciv-Dev] Re: (PR#15126) patch: fc_free macro
Home

[Freeciv-Dev] Re: (PR#15126) patch: fc_free macro

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: cp.ml.freeciv.dev@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#15126) patch: fc_free macro
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Jan 2006 11:00:24 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=15126 >

Christian Prochaska wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=15126 >
> 
> This patch adds a macro "fc_free" to utility/mem.h:
> 
> #define fc_free(ptr)       { free(ptr); ptr = NULL; }
> 
> It's meant to replace the "FREE" macro in gui-sdl/gui_mem.h (PR#3372),
> but might be useful at other places, too.

Such a macro violates the rules of function-looking macros.  That is, it 
looks like a function but it behaves as no function ever could.

If we have it (code like this is used in several places) it should be 
FC_FREE().

-jason





[Prev in Thread] Current Thread [Next in Thread]