[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Define DEBUG by default in mktime.c

From: Eric Blake
Subject: Re: Define DEBUG by default in mktime.c
Date: Thu, 26 Jun 2014 13:21:46 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 06/26/2014 12:02 PM, Siddhesh Poyarekar wrote:
> Hi,
> The DEBUG macro in mktime.c is not defined, but the checks on that
> macro are as if it is.  Instead of commenting out the definition of
> DEBUG, define it to 0 by default and adjust the comment to reflect
> that debugging needs the macro to be set to 1.
> Siddhesh
>       * lib/mktime.c: Define DEBUG to 0.
> diff --git a/lib/mktime.c b/lib/mktime.c
> index f10e530..077f9c4 100644
> --- a/lib/mktime.c
> +++ b/lib/mktime.c
> @@ -17,9 +17,9 @@
>     License along with the GNU C Library; if not, see
>     <http://www.gnu.org/licenses/>.  */
> -/* Define this to have a standalone program to test this implementation of
> +/* Define this to 1 to have a standalone program to test this implementation 
> of
>     mktime.  */
> -/* #define DEBUG 1 */
> +#define DEBUG 0

NACK.  This doesn't work well with the rest of the file, which only does:


which is well-defined by C99 even when DEBUG is undefined.  If your
compiler is warning, it is because you turned on too many warnings
compared to what gnulib is willing to support.

The other usage in the file is:

Local Variables:
compile-command: "gcc -DDEBUG -I. -Wall -W -O2 -g mktime.c -o mktime"

which is a handy way in emacs to automatically compile the test program;
but if you hard-code a #define without first checking #ifdef to see
whether a define was inherited via the -DDEBUG listed in that command
line, then you've broken this setup.

I see no reason to change anything here.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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