lcc compiler bug report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mathay lucien
    New Member
    • Jun 2012
    • 2

    #1

    lcc compiler bug report

    Can anyone tell me why, if the following code is legal, in lcc the first initialization is performed well, but the second one not ?

    int a= 1; int adress_of_a= (int) &a;
    ---> this works fine, adress_of_a is initialized with 0x0040....


    int a= 1; int adress_of_a[1]= { (int) &a };
    ---> this does not work, adress_of_a is initialized with 00000000.

    Thank you for your reply !

    Lucien MATHAY
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    This is an array:

    Code:
    int adress_of_a[1];
    When you display the name of an array you display the address of the array. You need to display adress_of_a[0] to display the result of your cast.

    Comment

    • mathay lucien
      New Member
      • Jun 2012
      • 2

      #3
      Thank you for your reply, I understand it.
      Actually the question is more : whether this is a bug or not in LCC compiler, and in this subject we have advanced in another discussion group. See on the comp.compilers. lcc on google groups if you are interested further.

      Otherwise, thank you for the time you spent in answering this question, I appreciate !

      Comment

      Working...