Christian Schoenebeck wrote: > > #ifdef YYNOMEM > > /* newer bison version */ > > YYNOMEM; > > #else > > /* older bison (undocumented feature) */ > > goto yyexhaustedlab; > > #endif > > You would be dealing with internals, but AFAICS that internal label > already exists for decades, so it'll be okay as pragmatic solution I > guess.
Just realized another problem -- I don't think I can use goto across functions like this. And even if the goto was valid in parser_alloc(), I'll need YYNOMEM for other functions, like strdup(). The simplest thing to do is probably shim YYNOMEM in my parser and use it directly: #ifndef YYNOMEM #define YYNOMEM goto yyexhaustedlab #endif