On Tue, May 17, 2005 at 12:24:43PM -0500, Albert Chin wrote:
> The Sun, HP, IBM, and SGI C compilers fail when building
> epan/ftypes/ftype-string.c:
> (Sun)
> "ftype-string.c", line 56: operands have incompatible types:
> int ":" void
>
> (HP)
> cc: "ftype-string.c", line 56: error 1553: Incompatible types in second and third operands of conditional expression (?:).
>
> (IBM)
> "ftype-string.c", line 56.5: 1506-226 (S) The ":" operator is not
> allowed between "int" and "void".
>
> (SGI)
> cc-1032 cc: ERROR File = ftype-string.c, Line = 56
> The indicated expression must have an arithmetic type.
>
> DISSECTOR_ASSERT(value != NULL);
> ^
How's the patch below?
--
albert chin (china@xxxxxxxxxxxxxxxxxx)
-- snip snip
--- epan/proto.h.orig 2005-05-17 12:34:40.000000000 -0500
+++ epan/proto.h 2005-05-17 12:34:56.000000000 -0500
@@ -98,8 +98,8 @@
* @param expression expression to test in the assertion
*/
#define DISSECTOR_ASSERT(expression) \
- ((void) ((expression) ? 0 : \
- __DISSECTOR_ASSERT (expression, __FILE__, __LINE__)))
+ ((expression) ? (void) 0 : \
+ __DISSECTOR_ASSERT (expression, __FILE__, __LINE__))
/** Same as DISSECTOR_ASSERT(), but will throw DissectorError exception
* unconditionally, much like GLIB's g_assert_not_reached works.