help-bison
[Top][All Lists]
Advanced

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

Re: ‘void free(void*)’ called on unallocated object ‘yyssa’ [-Wfree-nonh


From: Christoph Grüninger
Subject: Re: ‘void free(void*)’ called on unallocated object ‘yyssa’ [-Wfree-nonheap-object]
Date: Tue, 19 Jan 2021 08:21:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

Hi Akim,
thanks for sharing your thoughts! Being in charge is kind of a stretch for an open source project like CMake. You can write a patch, open an issue yourself, or I can try to take your advice and create a merge request.

https://gitlab.kitware.com/cmake

Bye
Christoph

Am 19.01.21 um 06:47 schrieb Akim Demaille:
Christoph,

FWIW, it appears that Bison is vastly underused in this grammar.
For instance, all these occurrences of $<str> should just read
$$ or $1.  Who is in charge of maintaining the parsers in there?

Start:
   GoalWithOptionalBackSlash {
     $<str>$ = 0;
     yyGetParser->SetResult($<str>1);
   }

GoalWithOptionalBackSlash:
   Goal {
     $<str>$ = $<str>1;
   }
| Goal cal_BSLASH {
     $<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
   }

Goal:
   {
     $<str>$ = 0;
   }
| String Goal {
     $<str>$ = yyGetParser->CombineUnions($<str>1, $<str>2);
   }


Not to below that here the actions are simply useless.

String:
   OuterText {
     $<str>$ = $<str>1;
   }
| Variable {
     $<str>$ = $<str>1;
   }

it should be

String:
   OuterText
| Variable
;




OuterText:
   cal_NAME {
     $<str>$ = $<str>1;
   }
| cal_AT {
     $<str>$ = $<str>1;
   }
| cal_DOLLAR {
     $<str>$ = $<str>1;
   }
[and so on and so on...]


--
Als wär es nix, leb' ich von [IT] und mach' nur, was ich lieb'
Lebe wie im Paradies, womit hab' ich das verdient?
Die Wahrheit ist: Hab' ich nicht, ich bin nur reicher beschenkt
Als jemand in einem armen Land mit dem gleichen Talent
[frei nach Tua von Die Orsons - Oioioiropa]



reply via email to

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