bug-bison
[Top][All Lists]
Advanced

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

Re: bison-1.30 build failure with K&R C compiler


From: Hans Aberg
Subject: Re: bison-1.30 build failure with K&R C compiler
Date: Tue, 18 Dec 2001 08:56:49 +0100

At 15:52 -0700 2001/12/17, Nelson H. F. Beebe wrote:
>However, the file ./src/vcg.c has statements like these:
>
>$ grep 'assert' ./src/vcg.c
>      assert (!"Not a default color.");
>      assert (!"Not a text mode.");
>      assert (!"Not a shape.");
>      assert (!"Not a layout algorithm.");
>      assert (!"Either yes nor no.");
>      assert (!"Not an orientation.");
>      assert (!"Not an alignement.");
>      assert (!"Not an arrow mode.");
>      assert (!"Not a crossing type.");
>      assert (!"Not a view.");
>      assert (!"Not a line style.");
>      assert (!"Not an arrow style.");
>
>These produce compilation failures, because the definition of
>the assert() macro from /usr/include/assert.h looks like this:
>
>#      define assert(_EX) \
>          ((_EX) ? (void)0 : __assert("_EX", __FILE__, __LINE__))
>
>The expansion then looks like this:
>
>       ((!"Not a shape.") ? (void)0 : __assert("!"Not a shape."",
>__FILE__, __LINE__))
>
>and that is syntactically wrong, since the quotes are handled incorrectly.

My compiler, under which the lines compiled, uses
#define assert(condition) ((condition) ? ((void) 0) :  \
          __assertion_failed(#condition,__FILE__, __LINE__))

Then the line
  assert (!"Not a default color.");
expands to:
  ((!"Not a default color.") ? ((void) 0) :
    __assertion_failed("!\"Not a default color.\"","vcg.c", 245)) ;

  Hans Aberg





reply via email to

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