patacongo commented on issue #3737:
URL: 
https://github.com/apache/incubator-nuttx/issues/3737#issuecomment-846608494


   
   > It fails namely here (struct_main.c) on attempt to call the function:
   > |97 mystruct->pf();|
   >
   > As you can see from the previous log
   >
   > |pf = 0xdcec (vs 0xdcec) PASS Calling mystruct->pf() arm_hardfault: 
   > PANIC!!! Hard fault: 40000000 |
   >
   > the called address is even. However, in Thumb mode it must be odd.
   > I tried to force it to be odd (by | 1) and the hard fault was fixed.
   >
   > If I understand correctly, the compiler should have initialized "pf" 
   > field of "struct struct_s dummy" to an odd address automatically, 
   > however it did not.
   >
   Yes, at some point bit 0 should have been set by the compiler before the 
   call.  This used to work and I can't explain why it should be failing in 
   this case.  It is really pretty generic C code.  The only purpose of 
   this test is to assure that a structure is initialized properly.
   
   It does seem like a compiler issue.  Could it believe that dummyfunc() 
   is an ARM (vs Thumb2) function?
   
   Sorry.  I'm no help on this one.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to