[Top][All Lists]

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

Re: too many warnings from Bison CVS for Pike

From: Joel E. Denny
Subject: Re: too many warnings from Bison CVS for Pike
Date: Tue, 14 Feb 2006 16:24:37 -0500 (EST)

On Thu, 9 Feb 2006 address@hidden wrote:

> Dynamic C-parserstack. This is what is Bison implements if  
> __cplusplus is not defined. However, this should work under C++ as  
> well for POD types. By the segment:
> #if (! defined (yyoverflow) \
>       && (! defined (__cplusplus) \
>        || (defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
>               && defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
> /* A type that is properly aligned for any stack member.  */
> union yyalloc
> {
>    short int yyss;
>    YYSTYPE yyvs;
>      YYLTYPE yyls;
> };
> ...
> you already have a test against non-POD types, as these cannot be  
> used in a union. So if one would want to use this dynamic stack with  
> a POD type, just remove the (! defined (__cplusplus) above.

I'm getting a little lost in this thread, so forgive me if I'm 
repeating....  Why is it necessary to remove the ! defined (__cplusplus)?  
If %union is defined, then YYSTYPE_IS_TRIVIAL.  If also 
YYLTYPE_IS_TRIVIAL, then union yyalloc and YYSTACK_RELOCATE() will be 
defined.  In this case, defined(__cplusplus) is irrelevant.

Am I missing something?

> But one might supply a macro, say CPP_SEMANTIC_POD, which signals  
> that the C++ semantic type is a POD, and that the dynamic C- 
> parserstack should be used.

%union seems to be enough.


reply via email to

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