>>> On 12.01.15 at 15:54, <george.dun...@eu.citrix.com> wrote:
> On Fri, Jan 9, 2015 at 12:10 PM, Jan Beulich <jbeul...@suse.com> wrote:
>>>>> On 09.01.15 at 12:45, <t...@xen.org> wrote:
>>> At 11:24 +0000 on 09 Jan (1420799087), Jan Beulich wrote:
>>>> >>> On 09.01.15 at 12:18, <t...@xen.org> wrote:
>>>> >> > +            default:
>>>> >> > +                xfree(buf);
>>>> >> > +                ASSERT(!buf);
>>>> >
>>>> > looks dodgy...
>>>>
>>>> In which way? The "default" is supposed to be unreachable, and sits
>>>> in the else branch to an if(!buf), i.e. in a release build we'll correctly
>>>> free the buffer, while in a debug build the ASSERT() will trigger.
>>>
>>> Oh I see.  Can you please use ASSERT(0) for that?
>>
>> I sincerely dislike ASSERT(0), but if that's the only way to get
>> the patch accepted...
> 
> Um, by what set of criteria is ASSERT(!buf) better than ASSERT(0)?  At
> least the second tells the reader that you're not using ASSERT() the
> normal way.

Because the resulting message ("0") is completely meaningless,
while for "!buf" you at least have a chance of finding the original
ASSERT() without line numbers matching up 100%.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to