help-bison
[Top][All Lists]
Advanced

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

'size_t' undeclared (first use in this function)


From: Tom Wang A
Subject: 'size_t' undeclared (first use in this function)
Date: Wed, 22 Jul 2015 09:17:47 +0000

Dear Sir,
I encounter a compiling error with bison 2.1. The output file y.tab.c cannot 
pass gcc compiling, while there is no such problem on bison 2.3. However, the 
linux server which installed bison 2.1 cannot be upgraded with bison 2.3 for 
some reason. So my question is,  how can I avoid such error with bison 2.1? The 
error is showed as:

y.tab.c: In function 'yytnamerr':
y.tab.c:718: error: 'size_t' undeclared (first use in this function)
y.tab.c:718: error: (Each undeclared identifier is reported only once
y.tab.c:718: error: for each function it appears in.)
y.tab.c:718: error: expected ';' before 'yyn'
y.tab.c:734: error: 'yyn' undeclared (first use in this function)

When I replace "size_t" with "YYSIZE_T" in y.tab.c:718 line, compiling can 
pass.  However, I don't think it is a graceful way to modify the auto-generated 
file manually, everytime.  I attach the files generated separately by bison 2.1 
and 2.3 for your convenience.

More information of the linux server installed with bison 2.1 is here:

eknoptf >uname -a
Linux esekilxxen931 2.6.16.60-0.77.1-xen #1 SMP Mon Mar 14 16:54:35 UTC 2011 
x86_64 x86_64 x86_64 GNU/Linux

eknoptf >gcc -v
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --enable-threads=posix --prefix=/usr 
--with-local-prefix=/usr/local --infodir=/usr/share/info 
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada 
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.2 
--enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib64 
--with-system-zlib --enable-shared --enable-__cxa_atexit 
--enable-libstdcxx-allocator=new --program-suffix= 
--enable-version-specific-runtime-libs --without-system-libunwind 
--with-cpu=generic --host=x86_64-suse-linux
Thread model: posix
gcc version 4.1.2 20070115 (SUSE Linux)

eknoptf >bison -V
bison (GNU Bison) 2.1
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Look forward to your early reply.

Best regards,
Tom

Attachment: y.tab.c.2.1
Description: y.tab.c.2.1

Attachment: y.tab.c.2.3
Description: y.tab.c.2.3


reply via email to

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