bug-gnulib
[Top][All Lists]
Advanced

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

Re: [bug-gnulib] Re: [bug-gnulib] Re: new gnulib module "verify" for com


From: Bruno Haible
Subject: Re: [bug-gnulib] Re: [bug-gnulib] Re: new gnulib module "verify" for compile-time assertions
Date: Tue, 27 Sep 2005 13:18:59 +0200
User-agent: KMail/1.5

Paul Eggert wrote:
> > Now one more simplification is possible: A variable declaration does it
> > just as nicely as a function declaration.
>
> But gcc -Wall warns about unused variables, even if they're extern.

Indeed. I wasn't aware of this. Sorry.

> The advantage of
> verify_true(R) is that it can be used in contexts where verify_expr(R)
> cannot (e.g., the initializer of an enum).

I'm trying to extend tests/test-verify.c to cover this case, but with

#include "verify.h"
enum {
  abc = (verify_true (1 + 1 == 2), 7)
};

I'm still getting the gcc error
  "enumerator value for 'abc' is not an integer constant"

What's the right syntax for using verify_true inside an enum initializer?

Bruno





reply via email to

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