Menu

#195 OnBC: Compile hangs with nested defines

Bug
open
nobody
OnBoard C (71)
5
2008-04-09
2006-02-26
GoldenUrg
No

#define RECWR(recP, type, field, value) OffsetOf(type,
field)
#define RECWRS(recP, type, field) RECWR(recP, type,
field, field)

main func(){
// RECWR(recP, UField, offset, offset); // OK
RECWRS(recP, UField, offset);
}

---
Hangs during compile and requires reset.

Discussion

  • Alexey Tatarsky

    Alexey Tatarsky - 2006-07-04

    Logged In: YES
    user_id=969565

    I've seen this problem too, and here is my two cents:

    it actually happens only when a formal parameter has the
    *same name* in outer and inner defines, as is the case with
    'type' and 'field' parameters in the example above.

    The workaround is to rename parameters, e.g.:

    #define RECWR(recP, type, field, value) OffsetOf(type,
    field)
    #define RECWRS(recP, _type, _field) RECWR(recP, _type,
    _field, _field)

     
  • John Wilund

    John Wilund - 2008-03-22

    Logged In: YES
    user_id=574706
    Originator: NO

    I seccond this! Please fix it as soon as possible!

    /John

     
  • John Wilund

    John Wilund - 2008-03-22
    • labels: 587913 --> OnBoard C
    • milestone: 349193 -->
     
  • John Wilund

    John Wilund - 2008-04-09

    Logged In: YES
    user_id=574706
    Originator: NO

    Steve, what do you say about this BUG?

     
  • John Wilund

    John Wilund - 2008-04-09
    • milestone: --> Bug
    • summary: OBC: Compile hangs with nested defines --> OnBC: Compile hangs with nested defines
     

Log in to post a comment.