#17 windres problem

closed
None
5
2002-08-14
2002-07-26
No

Just installed windres 2.12.90 hoping to resolve a
problem I saw in windres 2.11.90 but it did not.

My RC code is:

IDC_MYACCEL ACCELERATORS
BEGIN
"?", IDM_ABOUT, ALT // error
"/", IDM_ABOUT, ALT // error
VK_F10, IDM_RUN, VIRTKEY
"x", IDM_EXIT, ALT // error
END

With windres is gives the following error for the lines
above marked //error :-

"inappropriate modifiers for non-VIRTKEY"

This code compiled fine with the Borland RC compiler.
Can someone advise me if this is a bug or is
something wrong with my code.

Thanks.

Discussion

  • Earnie Boyd

    Earnie Boyd - 2002-08-05

    Logged In: YES
    user_id=15438

    Danny, do you have any insights?

     
  • Earnie Boyd

    Earnie Boyd - 2002-08-05
    • priority: 5 --> 1
    • assigned_to: nobody --> dannysmith
    • status: open --> pending
     
  • Luke Dunstan

    Luke Dunstan - 2002-08-11

    Logged In: YES
    user_id=30442

    In windres rcparse.y:

        if \(\($$.flags & ACC\_VIRTKEY\) == 0
        && \($$.flags & \(ACC\_SHIFT |
    

    ACC_CONTROL | ACC_ALT)) != 0)
    rcparse_warning (_("inappropriate modifiers
    for non-VIRTKEY"));

    Apparently windres only allows modifiers like "ALT" for
    virtual keys (as opposed to ASCII characters). I think this
    is incorrect because my win32.hlp file has an example:

    "B", ID_ACCEL5, ALT ; ALT_SHIFT+B
    "I", ID_ACCEL6, CONTROL, VIRTKEY ; CTRL+I

    So I think this check in windres is incorrect, but it is in fact
    a warning not an error, and windres still produces an output
    file.

     
  • Earnie Boyd

    Earnie Boyd - 2002-08-12

    Logged In: YES
    user_id=15438

    So, Luke, should the warning persist? Or, should this be patched to not issue the warning?

    Earnie.

     
  • Earnie Boyd

    Earnie Boyd - 2002-08-12
    • priority: 1 --> 5
    • assigned_to: dannysmith --> infidel
    • status: pending --> open
     
  • Luke Dunstan

    Luke Dunstan - 2002-08-13

    Logged In: YES
    user_id=30442

    After some investigation, I am more confused :).

    The MSDN documentation mentions these parameters,
    among others: event, type, options

    event: the keystroke, which can be one of:

    "char" - a single character enclosed in quotation marks
    (optionally prefixed by ^)
    character - an integer value representing a character.
    The 'type' parameter must be ASCII.
    virtual-key character - an integer value representing a virtual
    key. The 'type' parameter must be VIRTKEY. The virtual key
    for alphanumeric keys can be specified by placing the
    uppercase letter or number in double quotation marks.

    type: Required only when the event parameter is a character
    or a virtual-key character [implying that it is not required for a
    quoted character].

    options:
    ALT - Causes the accelerator to be activated only if the ALT
    key is down. **Applies only to virtual keys**.
    SHIFT - Causes the accelerator to be activated only if the
    SHIFT key is down. Applies only to virtual keys.
    ...

    Up to this point, it seems that windres is correct. However,
    the same page of MSDN contains an example contradicting
    this:

    "k", IDDELLIPSE, ALT ; alt k

    And compiling the following script:

    0x20 ACCELERATORS
    BEGIN
    "k", 0x3333, ALT
    END

    Gives no warnings with the MS resource compiler, but this
    script:

    0x20 ACCELERATORS
    BEGIN
    "g", 0x2222, CONTROL
    END

    Outputs this warning from MS RC:

    acc2.rc (4): warning RC4203 : SHIFT or CONTROL used
    without VIRTKEY

    This behaviour seems logical because SHIFT can be
    specified for an ASCII character with an uppercase letter or
    other character, and CONTROL can be specified with the ^
    prefix, while ALT cannot. In my opinion, windres should be
    changed to allow ALT for non-VIRTKEYs like MS RC.

     
  • Danny Smith

    Danny Smith - 2002-08-13

    Logged In: YES
    user_id=11494

    Luke, are you going to submit the obvious patch to
    binutils? I've test with yesterdays CVS and no
    regressions. Patch approval should be no problem if
    you include the testcases from your last message, plus
    another one with SHIFT.

    Danny

     
  • Luke Dunstan

    Luke Dunstan - 2002-08-14

    Logged In: YES
    user_id=30442

    It would take me some time to get the binutils source from
    CVS, so it would be quicker if you were to submit the patch
    that you have already tested. I don't mind either way, so if
    you don't have time I will do it.

    I can confirm that the following case gives a warning with MS
    RC:

    0x20 ACCELERATORS
    BEGIN
    "z", 0x4444, SHIFT
    END

    acc4.rc (4): warning RC4203 : SHIFT or CONTROL used
    without VIRTKEY

     
  • Danny Smith

    Danny Smith - 2002-08-14
    • status: open --> closed
     
  • Danny Smith

    Danny Smith - 2002-08-14

    Logged In: YES
    user_id=11494

    Thanks for tracking this down Luke
    Fixed in official CVS

    Danny

     
  • David Armour

    David Armour - 2002-08-21

    Logged In: YES
    user_id=580773

    Just a quick question:

    Has this patch/upgrade been done yet? If so where can I
    donwload it?

    Thanks,
    David :]

     
  • Luke Dunstan

    Luke Dunstan - 2002-08-21

    Logged In: YES
    user_id=30442

    The change has been made in the official binutils CVS (see
    http://sources.redhat.com/binutils/\). Next time Mingw binutils
    is released, you can download the updated binaries, or if you
    really want to you can download and build the CVS version.
    Since the message is only a warning, not an error, there
    shouldn't be any urgent need for it to be fixed.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks