bugAVR C Runtime Library - Bugs: bug #27434, Arguments of macros must be...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #27434: Arguments of macros must be protected in parentheses

Submitter:  Shaun Jackman <sjackman>
Submitted:  Sun 13 Sep 2009 06:58:38 PM UTC
Votes: 10
 
Category:  Header Severity:  4 - Important
Priority:  9 - Immediate Item Group:  Header files
Status:  Fixed Assigned to:  arcanum
Percent Complete:  100% Open/Closed:  Closed
Release:  1.6.7 Fixed Release:  1.6.3

Mon 14 Sep 2009 05:01:25 PM UTC, comment #2: 

Thanks for the quick response!

Shaun Jackman <sjackman>
Mon 14 Sep 2009 07:53:06 AM UTC, comment #1: 

Thanks for the bug report!

Should be fixed now in CVS.

Eric Weddington <arcanum>
Group administrator
Sun 13 Sep 2009 06:58:38 PM UTC, original submission:  

I noticed this bug with boot_page_fill, but it applies to pretty much every asm macro and macros in general. Macro arguments must be protected in parentheses. These two lines

          "z" ((uint16_t)address),               \
          "r" ((uint16_t)data)                   \

should be

          "z" ((uint16_t)(address)),               \
          "r" ((uint16_t)(data))                   \

otherwise the following code will break because the cast operation has higher precedence than the shift operation:

uint32_t u32 = 123456789;
boot_page_fill(0, u32 >> 16);

Fortunately, gcc gives a warning in this case.

Cheers,
Shaun

Shaun Jackman <sjackman>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arcanum (Posted a comment)
  • -email is unavailable- added by sjackman (Voted in favor of this item)
  • -email is unavailable- added by sjackman (Submitted the item)
  •  

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-09-14 arcanum Open/ClosedOpen Closed
        Fixed ReleaseNone 1.6.3
        Severity3 - Normal 4 - Important
        Priority5 - Normal 9 - Immediate
        StatusNone Fixed
        Percent Complete0% 100%
        Assigned toNone arcanum
    2009-09-13 sjackman Carbon-Copy- Added sjackman

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code