WINDRES grammar compatability

Roger Sayle roger@metaphorics.com
Wed Dec 29 16:51:00 GMT 1999


I recently discovered a "feature" of Microsoft's resource compilers when
switching to windres (both from binutils-2.9.1 and snapshot 991229).
Windres requires an explicit comma after the optional text argument at the
start of control's parameter list.  This is exactly the syntax in the
relevant Microsoft documentation, but not the behaviour of any of their
implementations. Hence I had to "correct" a resource file I've been
recompiling for years using Microsoft's tools.

I'm not sure if such an incompatability is considered a bug, but it is
relatively trivial to unambiguously extend windres' grammar.  All that
needs to be modified is the rule for "optstringc" in the file rcparse.y
to make the comma optional.

Forgive my "yacc", but something like the following:

*** rcparse.y.old   Wed Dec 29 16:55:03 1999
--- rcparse.y.new   Wed Dec 29 16:56:05 1999
*************** optstringc:
*** 797,802 ****
--- 797,806 ----
          {
            $$ = $1;
          }
+         | QUOTEDSTRING
+           {
+             $$ = $1;
+           }
        ;
  
  opt_control_data:



Roger
--
Roger Sayle,                         E-mail: roger@metaphorics.com
Bioinformatics Group, Metaphorics,   WWW: http://www.metaphorics.com/
Office 104, 441 Greg Avenue,         Tel: (+1) 505-954-3281
Santa Fe, New Mexico, 87501.         Fax: (+1) 505-989-1200



More information about the Binutils mailing list