broken dead code in pg_lzcompress.h - Mailing list pgsql-hackers

From Tom Lane
Subject broken dead code in pg_lzcompress.h
Date
Msg-id 1501.1160082295@sss.pgh.pa.us
Whole thread Raw
Responses Re: broken dead code in pg_lzcompress.h  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-hackers
I came across the following obviously corrupt macro in pg_lzcompress.h:

#define PGLZ_IS_COMPRESSED(_lzdata)        ((_lzdata)->varsize !=                \
e                                         (_lzdata)->rawsize +            e    \
           sizeof(PGLZ_Header))
 
The reason we have not noticed its brokenness is that it's only used in
macro pglz_decomp_init, which is used nowhere.  In fact there seems to
be quite a lot of dead code in this header.  I'm inclined to remove
everything that's not referenced, rather than try to fix it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Upgrading a database dump/restore
Next
From: Jan Wieck
Date:
Subject: Re: broken dead code in pg_lzcompress.h