9 } Values[2]= {{{"abc", "def"}}, {{"ghi", "jkl"}}};
16 volatile char code* * p;
18 //first subexpression 'Values[0].Name' is evaluted as follows:
20 //mov r3,#(_Values >> 8)
21 //mov r4,#(_Values >> 16) ;this is wrong - should be 'mov r4,#128' shouldn't it?
22 //second subexpression 'Values[1].Name' is evaluted as follows:
27 //addc a,#(_Values >> 8)
29 //mov r4,#128 ;this is all right
30 p = i ? Values[0].Name : Values[1].Name;
31 #if defined(SDCC_mcs51)
33 ASSERT((unsigned char)(v>>16)==0x80);
36 //everything is all right with explicit typecast - but why do I need it?
37 p = i ? (char code**)Values[0].Name : (char code**)Values[1].Name;
38 #if defined(SDCC_mcs51)
40 ASSERT((unsigned char)(v>>16)==0x80);
43 //this is the best/optimal version - again with explicit typecast
44 //Question: Why is it necessary to have explicit typecast to make things right?
45 p = i ? (char code* code*)Values[0].Name : (char code* code*)Values[1].Name;
46 #if defined(SDCC_mcs51)
48 ASSERT((unsigned char)(v>>16)==0x80);
55 volatile char code* * p;
57 //'Values[0].Name' subexpression is evaluated as follows first:
59 //mov r3,#(_Values >> 8)
60 //mov r4,#(_Values >> 16) ;this is wrong - see bug 1839277
61 p= i ? Values[0].Name : Values[1].Name;
62 //this assignment has some sideeffect on the following one
63 //in fact it is the evaluation of 'Values[0].Name' itself has the effect, not the assignment
65 //'Values[0].Name' subexpression is evaluated as follows second:
67 //mov r3,#(_Values >> 8)
68 //mov r4,#0x00 ;this is different from first occurrence but also wrong
69 p= i ? Values[0].Name : Values[1].Name;
70 #if defined(SDCC_mcs51)
72 ASSERT((unsigned char)(v>>16)==0x80);