Describe the bug
Compile error when I define _TX_ENABLE_EVENTTRACE in "tx_user.h". My system is AARCH64 architecture.
When I define _TX_ENABLE_EVENTTRACE in "tx_user.h" and then compile code, the compiler show me the below error info:
mypath/threadx/tx_misra.c: In function ‘_tx_misra_trace_event_insert’:
mypath/threadx/tx_misra.c:341:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
341 | trace_system_state = (UINT32) _tx_thread_system_state;
| ^
mypath/threadx/tx_misra.c:342:26: error: assignment to ‘TX_THREAD *’ {aka ‘struct TX_THREAD_STRUCT *’} from incompatible pointer type ‘TX_THREAD **’ {aka ‘struct TX_THREAD_STRUCT **’} [-Werror=incompatible-pointer-types]
342 | trace_thread_ptr = _tx_thread_current_ptr;
| ^
mypath/threadx/tx_misra.c:348:33: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
348 | trace_priority = (UINT32) trace_thread_ptr;
| ^
mypath/threadx/tx_misra.c:354:73: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
354 | trace_event_ptr -> tx_trace_buffer_entry_thread_pointer = (UINT32) trace_thread_ptr;
| ^
mypath/threadx/tx_misra.c:359:73: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
359 | trace_event_ptr -> tx_trace_buffer_entry_info_1 = (UINT32) (info_field_1);
| ^
mypath/threadx/tx_misra.c:373:79: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
373 | _tx_trace_header_ptr -> tx_trace_header_buffer_current_pointer = (UINT32) trace_event_ptr;
| ^
mypath/threadx/tx_misra.c:378:79: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
378 | _tx_trace_header_ptr -> tx_trace_header_buffer_current_pointer = (UINT32) trace_event_ptr;
The reason is that __tx_thread_systemstate is defined as a array, but is used as a function here.
If I delete the below code in "tx_api_SMP_A64.h" and delete the function implementation of __tx_misra_trace_eventinsert.In this case, the _TX_TRACE_IN_LINEINSERT will be defined as a macro in "tx_trace_A64.h". It still doesn't work well.
In case you have defined TX_MISRA_ENABLE, tx_misra.c should not be used directly in your project. Follow the instructions here to convert C file to assembly file.
Describe the bug Compile error when I define _TX_ENABLE_EVENTTRACE in "tx_user.h". My system is AARCH64 architecture.
When I define _TX_ENABLE_EVENTTRACE in "tx_user.h" and then compile code, the compiler show me the below error info:
The reason is that __tx_thread_systemstate is defined as a array, but is used as a function here.
If I delete the below code in "tx_api_SMP_A64.h" and delete the function implementation of __tx_misra_trace_eventinsert.In this case, the _TX_TRACE_IN_LINEINSERT will be defined as a macro in "tx_trace_A64.h". It still doesn't work well.
Expected behavior I expect "_tx_misra_trace_event_insert" can works well. And I want to know whether i can ignore the Werror or not.