bison warning fixes

Nick Clifton
Tue Oct 18 10:27:00 GMT 2016

Hi Maciej,

>  This has regressed the `rx-elf' target:
> /bin/sh .../gas/../ylwrap .../gas/config/rx-parse.y rx-parse.c rx-parse.h -- bison -y   -d ;
> .../gas/config/rx-parse.y:133.14-18: syntax error, unexpected string, expecting =
> make[4]: *** [rx-parse.c] Error 1
> with bison 2.3 here.  Do we want to have a minimum version requirement 
> (and presumably enforce it with autoconf)?

The problem with this approach is that bison is only needed if the rx-parse.y
file is altered, or if the user accidentally touches it, or if the sources are
installed from a tarball and the rx-parse.y file has the same date/time as the
rx-parse.c file, or the user is using an old/buggy make.  In the normal course
of events however building the RX assembler will not require bison, and refusing
to build it because an outdated version of bison is installed would be wrong.

Since building rx-parse.c is not conditional upon maintainer-mode being enabled
we cannot conditionalize a test of the bison version in use.  (Maybe we should
change this and make the rx-parse.c build rule conditional on maintainer mode
and then we could add a version test).

An alternative approach is to add the version requirement to the rx-parse.y 
file itself, like this:

diff --git a/gas/config/rx-parse.y b/gas/config/rx-parse.y
index 72e03b7..600769f 100644
--- a/gas/config/rx-parse.y
+++ b/gas/config/rx-parse.y
@@ -17,6 +17,8 @@
    along with GAS; see the file COPYING.  If not, write to the Free
    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
+%require "3.0.0"
 #include "as.h"

(I just chose 3.0.0 as an example version requirement.  I do not know what the
actual version number should be).

This would be safer, I think.  What do you think ?


More information about the Binutils mailing list