[Freeciv-Dev] Re: (PR#6380) remove is_real and is_valid sanity variables
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] Re: (PR#6380) remove is_real and is_valid sanity variables |
From: |
"Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx> |
Date: |
Tue, 7 Oct 2003 01:50:17 -0700 |
Reply-to: |
rt@xxxxxxxxxxxxxx |
Guest wrote:
> [jdorje - Fri Oct 3 19:32:07 2003]:
>
>
>>John Wheeler wrote:
>>
>>>[jdorje - Thu Oct 2 23:47:02 2003]:
>>>
>>>
>>>
>>>>Most places in the code use this form:
>>>>
>>>> if (!normalize_map_pos(&x, &y)) {
>>>> assert(0);
>>>> }
>>>
>>>
>>>Hmm... for a quick solution, would "assert(normalize_map_pos(&x,
>
> &y);"
>
>>>work?
>>
>>No, it absolutely would not. Anything include in the assertion is
>
> not
>
>>compiled at all if debugging is not used.
>
>
> What the heck!?!
>
> ... searching assert.h ...
>
> #ifdef NDEBUG
> #define assert(x) (x)
> #else
From 'man assert' (in glibc):
If the macro NDEBUG was defined at the moment <assert.h>
was last included, the macro assert() generates no code, and
hence does nothing at all. Otherwise, the macro assert() prints
an error message to standard output and terminates the program by
calling abort() if expression is false (i.e., compares equal to
zero).
assert is defined by ANSI C. I haven't read the full spec, however;
perhaps the behavior is unspecified in the NDEBUG case.
jason
[Freeciv-Dev] (PR#6380) remove is_real and is_valid sanity variables, John Wheeler, 2003/10/06
[Freeciv-Dev] (PR#6380) remove is_real and is_valid sanity variables, Guest, 2003/10/06
- Message not available
- [Freeciv-Dev] Re: (PR#6380) remove is_real and is_valid sanity variables,
Jason Short <=
|
|