Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: warnings when compiling with NDEBUG (PR#1216)
Home

[Freeciv-Dev] Re: warnings when compiling with NDEBUG (PR#1216)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: warnings when compiling with NDEBUG (PR#1216)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 2 Feb 2002 16:33:44 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, Jan 09, 2002 at 03:04:17PM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
> gcc gives a number of warnings when compiling with ./configure 
> --disable-debug.  The attached patch should remove these.

> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/server/sanitycheck.c,v
> retrieving revision 1.13
> diff -u -r1.13 sanitycheck.c
> --- server/sanitycheck.c      2001/10/14 21:02:17     1.13
> +++ server/sanitycheck.c      2002/01/09 23:01:32
> @@ -24,6 +24,8 @@
>  
>  #include "sanitycheck.h"
>  
> +#ifdef DEBUG
> +
>  /**************************************************************************
>  ...
>  **************************************************************************/
> @@ -265,11 +267,14 @@
>    } players_iterate_end;
>  }
>  
> +#endif /* DEBUG */
> +
>  /**************************************************************************
>  ...
>  **************************************************************************/
>  void sanity_check(void)
>  {
> +#ifdef DEBUG
>    check_specials();
>    check_fow();
>    check_misc();
> @@ -277,4 +282,5 @@
>    check_cities();
>    check_units();
>    check_players();
> +#endif /* DEBUG */
>  }

Why these changes? I would understand:

"#ifndef NDEBUG" but not "#ifdef DEBUG".

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "The very concept of PNP is a lovely dream that simply does not translate to
  reality. The confusion of manually doing stuff is nothing compared to the
  confusion of computers trying to do stuff and getting it wrong, which they
  gleefully do with great enthusiasm." 
    -- Jinx Tigr in the SDM


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