Skip to content

Commit

Permalink
ghs: fix the naked_function attr cannot handle warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
guoshichao committed Nov 11, 2024
1 parent 56c920c commit 33e0869
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/nuttx/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 33e0869

Please sign in to comment.