Am Sonntag, 3. September 2006 19:53 schrieb Christian Ohm: > On Friday, 1 September 2006 at 23:26, Per Inge Mathisen wrote: > > On 9/1/06, Christian Ohm <[EMAIL PROTECTED]> wrote: > > >This patch consists mostly of casts to make Warzone compile with g++ > > >-fpermissive. I'll reply to this mail with comments on a few changes. > > > > You forgot to add an actual return value in debug(). > > Intentionally omitted, not forgotten. The problem is the definition of > ASSERT which looks like this: > > (void)( x ? 0 : debug( LOG_ERROR, __VA_ARGS__ ) ); > > On this (and the next, similar) line g++ complains about "error: > ‘debug(LOG_ERROR, ((const char*)"blkInitialise: Blocks already > initialised"))’ has type ‘void’ and is not a throw-expression". So debug > needs a non-void return type, and this was the only solution I've found > (casting in the macro doesn't work, then g++ complains about void not > being ignored like it should). I am hitting the same error here with G++ 4.1.1 As I got that style of ASSERT() macro from assert.h, I tried to throw everything from assert.h at debug() and ASSERT() but it didn't help. [was talking on ##c++] Hah! Now I got the solution!!! G++ throws a stupid error message, that is all. ( (expr) ? (void)0 : debug() ) works. The problem before was that 0 has a different type than debug() and in ( x ? y : z) y and z must be of the same type.
Description: PGP signature
_______________________________________________ Warzone-dev mailing list Warzonefirstname.lastname@example.org https://mail.gna.org/listinfo/warzone-dev