Windres problem with Boling book example
Danny Backx
danny.backx@scarlet.be
Mon Nov 27 21:45:00 GMT 2006
I've attached the patch.
As I already said this uses the sample code that Nick wrote. I ended up
making two changes to it :
- fix the small bug
- extend the lex pattern so more characters stop a keyword
I've run eight of the Boling book example through this. I can get most
of them to process correctly; after finding more literals that we don't
yet have in our include files. (Our project is in the process of
building up some of the include files, see
http://cegcc.sourceforge.net). That doesn't interfere with whether these
files are processed correctly though.
A couple of the files I tried don't process yet, but the original
windres behaves in the same way, so I am confident that this behaviour
is unrelated to this patch.
One remark: windres is rather bad at describing the syntax errors it
reports; it basically says something like
arm-wince-mingw32ce-windres: gapishow.rc:82: syntax error
without further explanation. I've not tried to address this.
A proposed ChangeLog entry, if this patch is accepted :
2006-11-27 Danny Backx <dannybackx@users.sourceforge.net>
* binutils/rclex.l : Accept keywords in lower and mixed case,
not just upper case. Based on code by Nick Clifton.
-- Danny
On Sat, 2006-11-25 at 11:22 +0100, Danny Backx wrote:
> On Sat, 2006-11-25 at 09:24 +0000, Nick Clifton wrote:
> > Hi Dave,
> >
> > >>>> The problem is that binutils's windres appears to expect all the
> > >>>> keywords such as DISCARDABLE to be in upper case.
> > >>> Do you know if windres accepts mixed case keywords as well, eg
> > >>> "DiScArDaBlE", or just either all-upper-case or all-lower-case ?
> > >> It doesn't, as you would expect by reading the code. It just accepts all
> > >> upper case.
> > >
> > > I think it could reasonably be inferred that Nick meant to ask after
> > > windows' rc.exe and windres was a slip of the finger, no?
> >
> > It was. Doh!
> >
> > So - Danny - how does rc.exe behave ?
>
> This required kicking my kids off the Windows PC :-)
>
> I've built the chap06/dlgdemo application with evc 4, and it did that
> flawlessly. Then I tweaked some of the "discardable" keywords so they
> contain mixed case as you asked. The resulting rc file contains lines
> such as shown here :
>
> dannypc: {41} fgrep -i disc *.rc
> ID_MENU MENU DISCARDABLE
> ID_BTNPAGE DIALOG disCARdable 0, 0, 125, 90
> ID_EDITPAGE DIALOG DisCarDable 0, 0, 80, 80
> ID_LISTPAGE DIALOG discardable 0, 0, 125, 80
> ID_STATPAGE DIALOG discardable 0, 0, 130, 80
> <cut>
>
> evc4 still managed to build the code.
>
> I was inclined to reply before doing this, because the Boling book is
> published by Microsoft Press. All of the examples in there are certain
> to compile. But now we have more info: it supports mixed case keywords.
>
> Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x
Type: text/x-patch
Size: 6645 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20061127/a2480a39/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <https://sourceware.org/pipermail/binutils/attachments/20061127/a2480a39/attachment.sig>
More information about the Binutils
mailing list