framework - Find/remove useless ifdefs and dead code within them

Matúš Kukan matus.kukan at gmail.com
Sat Nov 10 09:56:24 PST 2012


On 10 November 2012 17:51, Marcos Souza <marcos.souza.org at gmail.com> wrote:
> Hi List!
>
> Some days ago, I developed a script that can show to us all ifdefs that
> don't have a "#define".
>
> After run this script in the "framework" dir, I get this list:
>
> ifdef ENABLE_COMPONENT_SELF_CHECK without #define. This can be removed?
> ifdef DBG_UTIL without #define. This can be removed?
> ifdef fpf without #define. This can be removed?
> ifdef fpc without #define. This can be removed?
> ifdef ENABLE_SERVICEDEBUG without #define. This can be removed?
> ifdef ENABLE_TARGETINGDEBUG without #define. This can be removed?
> ifdef ENABLE_REGISTRATIONDEBUG without #define. This can be removed?
> ifdef ENABLE_PLUGINDEBUG without #define. This can be removed?
> ifdef ENABLE_MUTEXDEBUG without #define. This can be removed?
> ifdef ENABLE_FILTERDBG without #define. This can be removed?
> ifdef ENABLE_EVENTDEBUG without #define. This can be removed?
> ifdef ENABLE_GENERATEFILTERCACHE without #define. This can be removed?
>
> This is the output of my script. I belive DBG_UTIL is defined in an other
> way (a lot of code within this ifdefs around the LO) but I didn't notice any
> define explicitly.

git grep DDBG_UTIL points to solenv/gbuild/gbuild.mk, where also
others are defined (probably not from this list).
But for some, it's not that obvious and grepping for D<name> does not
help, see for example gb_Helper_define_if_set.

All the best,
Matus


More information about the LibreOffice mailing list