I am already using this macro to update the column info. Just wanted to avoid the warning.
On Sat, Apr 1, 2017 at 1:20 AM, Gabriel Czernikier <gabo...@gmail.com> wrote: > You'd also consider on using the macro that updates yylloc as the parser > goes ahead, it's # define YYLLOC_DEFAULT(Cur, Rhs, N) > > If you didn't did that in advance by means of updating yylloc in yylex or > in the semantic actions... > > ---------- Forwarded message ---------- > From: Gabriel Czernikier <gabo...@gmail.com> > Date: Fri, Mar 31, 2017 at 4:30 PM > Subject: Re: User defined YYLTYPE with YYLTYPE_IS_TRIVIAL defined as 1 > To: debashi...@gmail.com > Cc: help-bison@gnu.org > > > The following could be placed anywhere in your declarations section > (before the first occurrence of "%%"): > > %initial-action > { > @$.member_1 = 1; > @$.member_2 = 1; > ... > @$.member_6 = 1; > }; > > The YYLTYPE_IS_TRIVIAL is probably better not to be arround. > > Regards, > Gabriel > > ------------------------------ > *From*: Debashis De > *Subject*: User defined YYLTYPE with YYLTYPE_IS_TRIVIAL defined as 1 > *Date*: Fri, 31 Mar 2017 11:03:52 +0530 > ------------------------------ > > Hi, > > I have (re)defined YYLTYPE and added two more members after the usual > first line/col and last line/col. So, I have 6 unsigned fields in YYLTYPE. > I have also defined YYLTYPE_IS_TRIVIAL as 1. > > Now, Bison 3.0.4 generates the following code: > /* Location data for the lookahead symbol. */ > YYLTYPE yylloc > # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL > = { 1, 1, 1, 1 } > # endif > ; > > As you can see, it only initializes the default 4 members and not the > two new one I added. For this, g++ 4.7.2 produces compiler warning: > "missing initializer for member ...". > > Does anyone know how can I initialize yylloc myself and include the > initialization for all the members? > > Thanks and regards, > Debashis > > -- > *Things are to be used, people are to be loved. Do not do it the other way > round.* > > > > -- *Things are to be used, people are to be loved. Do not do it the other way round.* _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison