Strange compile error

David Collier-Brown davecb at canada.sun.com
Wed May 3 16:48:30 GMT 2000


Ron Alexander wrote:
> SMB_ASSERT(b) ((b)?(void)0: \
> (DEBUG(0,("PANIC: assert failed at %s(%d)\n", \
>  __FILE__, __LINE__)), smb_panic("assert failed")))
> 
> gives this diagnostic 
> 
> 067** 1081: A void object is referenced in a context where a valid 
>	object is required; an object of type int is assumed.

	(void) 0 makes the Sun cc cross it's eyes, too.

"foo.c", line 7: operands have incompatible types:
         void ":" int

	This is a fatal error, as the code generator can't compare
	an non-storage type, non-constant to a word... I strongly
	suspect this is illegal c, too.

	Can some kind soul amend includes/smb.h to change
		(b)?(void)0
	to
		(b)? 0
	in the cvs repository?

--dave
-- 
David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | //www.oreilly.com/catalog/samba/author.html
Work: (905) 415-2849 Home: (416) 223-8968 Email: davecb at canada.sun.com


More information about the samba-technical mailing list