This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

all my C++ code runs well in vs2019, however it cannot initialize member variables in the right way if compilied in KEIL V5.

my derived class xxxMessage contain two class objects  xxxQueue and xxxMutex as member, but it seems KEIL compiles them as member function (I add __packed and found this problem in KEIL).

As a result, the first member variable of objects  xxxQueue and xxxMutex set with wrong value and the second member variable carry with the value  first member variable  set manually, it seem bytes alignment problems 

but some values seems has been insert into the RAM memory position of the first member variable of both objects . ALL my member variables are 32bits int so I dont think it's  bytes alignment problems . I wonder to know why KEIL treat the two class objects as member function? and the two" member function " copy the position of the first member variable.

ALL my code runs well in vs2019 and does not have such problems .