Ben Pfaff <b...@nicira.com> schrieb:
>On Fri, Dec 13, 2013 at 10:30:56AM -0800, Ben Pfaff wrote:
>> On Fri, Dec 13, 2013 at 06:54:27PM +0100, Helmut Schaa wrote:
>> > Reduces binary size. Use a static inline function instead of
>> > a macro to not get "unused variable" warnings everywhere.
>> > 
>> > Making ovs_assert an empty inline in the header file effectively
>> > optimizes out all calls to ovs_assert.
>> > 
>> > Signed-off-by: Helmut Schaa <helmut.sc...@googlemail.com>
>> > ---
>> >  lib/util.h | 7 ++++++-
>> >  1 file changed, 6 insertions(+), 1 deletion(-)
>> > 
>> > diff --git a/lib/util.h b/lib/util.h
>> > index 975d1a9..cc70f0e 100644
>> > --- a/lib/util.h
>> > +++ b/lib/util.h
>> > @@ -68,11 +68,16 @@
>> >   *
>> >   *   - Writes the failure message to the log.
>> >   *
>> > - *   - Not affected by NDEBUG. */
>> > + *   - Gets optimized out by NDEBUG. */
>> 
>> This list is supposed to be *differences* from assert() ;-)
>> 
>> I changed the list item to 
>>     - NDEBUG only affects the first time util.h is included.
>> 
>> and I'll apply this soon.
>
>Oh, except that when I actually build with -DNDEBUG, I get
>
>    ../tests/test-byte-order.c: In function 'main':
>../tests/test-byte-order.c:29:20: error: unused variable 'll'
>[-Werror=unused-variable]
>../tests/test-byte-order.c:28:20: error: unused variable 'l'
>[-Werror=unused-variable]
>../tests/test-byte-order.c:27:20: error: unused variable 's'
>[-Werror=unused-variable]
>
>which isn't the fault of this patch but we should fix it, but worse, it
>makes the ovs_assert test fail, as follows.  I'd like to get that fixed
>before applying it.

Ah, right. I'll look into this next week ...

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to