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

 
 

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

Submitted by:  Shaun Jackman <sjackman>
Submitted on:  Sun 13 Sep 2009 06:58:38 PM UTC  
Votes:  10  
 
Category: HeaderSeverity: 4 - Important
Priority: 9 - ImmediateItem Group: Header files
Status: FixedPercent Complete: 100%
Assigned to: Eric Weddington <arcanum>Open/Closed: Closed
Release: 1.6.7Fixed Release: 1.6.3

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 14 Sep 2009 07:53:06 AM UTCarcanumOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>1.6.3
      Severity3 - Normal=>4 - Important
      Priority5 - Normal=>9 - Immediate
      StatusNone=>Fixed
      Percent Complete0%=>100%
      Assigned toNone=>arcanum
    Sun 13 Sep 2009 06:59:07 PM UTCsjackmanCarbon-Copy-=>Added sjackman

    Back to the top


    Powered by Savane 3.1-cleanup1