ghs: fix the naked_function attr cannot handle warning

with greenhills version older than 202354, the __attribute__((naked))
cannot handled by greenhills compiler, and will report warning:

"/home/guoshichao/work_profile/vela_os/vela_car_6/nuttx/arch/arm/src/armv7-m/arm_svcall.c", line 79: warning #1097-D:
          unknown attribute "naked"
  static void dispatch_syscall(void) naked_function;
                                     ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
guoshichao 2024-10-22 14:13:46 +08:00 committed by Xiang Xiao
parent 6036a318f4
commit f94e092fad

View file

@ -240,7 +240,11 @@
* the function prolog and epilog.
*/
# define naked_function __attribute__((naked,no_instrument_function))
# if !defined(__ghs__) || __GHS_VERSION_NUMBER >= 202354
# define naked_function __attribute__((naked,no_instrument_function))
# else
# define naked_function
# endif
/* The always_inline_function attribute informs GCC that the function should
* always be inlined, regardless of the level of optimization. The