X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/39aa5b577e6b01f53ed68e7851dcd982e0bb8015..62fa1dac8cf3098d212c0e8f4b3cc2cadaddd4c5:/src/parse.y diff --git a/src/parse.y b/src/parse.y index bf22718..c66a803 100644 --- a/src/parse.y +++ b/src/parse.y @@ -109,11 +109,18 @@ * name strings can be used directly in error messages and there is no * need for any string processing. */ -#define yytnamerr(a, b) cdecl__strlcpy(a, b, (a) ? INT_MAX : 0) +#define yytnamerr(a, b) ( (a) ? yytnamerr_copy(a, b) \ + : strlen(b) ) + +static size_t yytnamerr_copy(char *dst, const char *src) +{ + return cdecl__strlcpy(dst, src, strlen(src)+1); +} %} %code requires { #include +#include } %code provides { @@ -125,7 +132,7 @@ const char *cdecl__token_name(unsigned token); %union { uintmax_t uintval; unsigned spectype; - _Bool boolval; + bool boolval; struct cdecl_declspec *declspec; struct cdecl_declarator *declarator; struct cdecl *decl;