Changeset d7a48e1 in rtems


Ignore:
Timestamp:
Oct 6, 2020, 5:39:44 AM (10 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
e261df0
Parents:
e1a0e0c3
git-author:
Sebastian Huber <sebastian.huber@…> (10/06/20 05:39:44)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/10/20 12:00:37)
Message:

rtems: Improve RTEMS_NO_RETURN attribute

Provide RTEMS_NO_RETURN also in case RTEMS_DEBUG is defined to prevent errors
like this:

error: no return statement in function returning non-void [-Werror=return-type]

Use C11 and C++11 standard means to declare a no-return function.

Close #4122.

Files:
31 edited

Legend:

Unmodified
Added
Removed
  • bsps/include/bsp/bootcard.h

    re1a0e0c3 rd7a48e1  
    6969 * executed after RTEMS is initialized.
    7070 */
    71 void boot_card(const char *cmdline) RTEMS_NO_RETURN;
     71RTEMS_NO_RETURN void boot_card(const char *cmdline);
    7272
    7373struct Per_CPU_Control;
  • bsps/powerpc/qoriq/include/bsp.h

    re1a0e0c3 rd7a48e1  
    8989#endif
    9090
    91 void bsp_restart(void *addr) RTEMS_NO_RETURN;
     91RTEMS_NO_RETURN void bsp_restart(void *addr);
    9292
    9393void *bsp_idle_thread( uintptr_t ignored );
     
    120120void qoriq_start_thread(struct Per_CPU_Control *);
    121121
    122 void qoriq_restart_secondary_processor(
     122RTEMS_NO_RETURN void qoriq_restart_secondary_processor(
    123123  const qoriq_start_spin_table *spin_table
    124 ) RTEMS_NO_RETURN;
     124);
    125125
    126126void qoriq_initialize_exceptions(void *interrupt_stack_begin);
  • bsps/sparc/leon3/include/leon.h

    re1a0e0c3 rd7a48e1  
    397397void leon3_ext_irq_init(void);
    398398
    399 void leon3_power_down_loop(void) RTEMS_NO_RETURN;
     399RTEMS_NO_RETURN void leon3_power_down_loop(void);
    400400
    401401static inline uint32_t leon3_get_cpu_count(
  • cpukit/include/rtems/fatal.h

    re1a0e0c3 rd7a48e1  
    1717#define _RTEMS_FATAL_H
    1818
    19 #include <rtems/score/basedefs.h> /* RTEMS_NO_RETURN */
     19#include <rtems/score/basedefs.h>
    2020#include <rtems/extension.h>
    2121
     
    6969 * @see _Terminate().
    7070 */
    71 void rtems_fatal_error_occurred(
    72   uint32_t   the_error
    73 ) RTEMS_NO_RETURN;
     71RTEMS_NO_RETURN void rtems_fatal_error_occurred( uint32_t the_error );
    7472
    7573/**
  • cpukit/include/rtems/init.h

    re1a0e0c3 rd7a48e1  
    4747 * This directive does not return.
    4848 */
    49 void rtems_initialize_executive(void)
    50   RTEMS_NO_RETURN;
     49RTEMS_NO_RETURN void rtems_initialize_executive( void );
    5150
    5251/**
     
    5857 * source of RTEMS_FATAL_SOURCE_EXIT and the specified result code.
    5958 */
    60 void rtems_shutdown_executive(
    61   uint32_t   result
    62 ) RTEMS_NO_RETURN;
     59RTEMS_NO_RETURN void rtems_shutdown_executive( uint32_t result );
    6360
    6461#ifdef __cplusplus
  • cpukit/include/rtems/rtems/tasks.h

    re1a0e0c3 rd7a48e1  
    431431);
    432432
    433 void rtems_task_exit( void ) RTEMS_NO_RETURN;
     433RTEMS_NO_RETURN void rtems_task_exit( void );
    434434
    435435/**
  • cpukit/include/rtems/score/assert.h

    re1a0e0c3 rd7a48e1  
    7979    /* normal build is newlib. */
    8080
    81     void __assert_func(const char *, int, const char *, const char *)
    82       RTEMS_NO_RETURN;
    83 
    8481    #define _Assert( _e ) \
    8582       ( ( _e ) ? \
  • cpukit/include/rtems/score/basedefs.h

    re1a0e0c3 rd7a48e1  
    9595 *  rtems_fatal_error_occurred and _Terminate.
    9696 */
    97 #if defined(RTEMS_SCHEDSIM)
    98   #define RTEMS_NO_RETURN
    99 #elif defined(__GNUC__) && !defined(RTEMS_DEBUG)
     97#if __cplusplus >= 201103L
     98  #define RTEMS_NO_RETURN [[noreturn]]
     99#elif __STDC_VERSION__ >= 201112L
     100  #define RTEMS_NO_RETURN _Noreturn
     101#elif defined(__GNUC__)
    100102  #define RTEMS_NO_RETURN __attribute__((__noreturn__))
    101103#else
  • cpukit/include/rtems/score/interr.h

    re1a0e0c3 rd7a48e1  
    262262 * @see rtems_fatal() and _Internal_error().
    263263 */
    264 void _Terminate(
     264RTEMS_NO_RETURN void _Terminate(
    265265  Internal_errors_Source  the_source,
    266266  Internal_errors_t       the_error
    267 ) RTEMS_NO_RETURN;
     267);
    268268
    269269/**
     
    275275 * @see _Terminate().
    276276 */
    277 void _Internal_error( Internal_errors_Core_list core_error ) RTEMS_NO_RETURN;
     277RTEMS_NO_RETURN void _Internal_error( Internal_errors_Core_list core_error );
    278278
    279279#ifdef __cplusplus
  • cpukit/include/rtems/score/smpimpl.h

    re1a0e0c3 rd7a48e1  
    125125 * @param cpu_self The current processor control.
    126126 */
    127 void _SMP_Start_multitasking_on_secondary_processor(
     127RTEMS_NO_RETURN void _SMP_Start_multitasking_on_secondary_processor(
    128128  Per_CPU_Control *cpu_self
    129 ) RTEMS_NO_RETURN;
     129);
    130130
    131131/**
  • cpukit/include/rtems/score/threadimpl.h

    re1a0e0c3 rd7a48e1  
    123123 * the non-multitasking part of the system initialization.
    124124 */
    125 void _Thread_Start_multitasking( void ) RTEMS_NO_RETURN;
     125RTEMS_NO_RETURN void _Thread_Start_multitasking( void );
    126126
    127127/**
     
    260260 * @param lock_context The lock context.
    261261 */
    262 void _Thread_Restart_self(
     262RTEMS_NO_RETURN void _Thread_Restart_self(
    263263  Thread_Control                 *executing,
    264264  const Thread_Entry_information *entry,
    265265  ISR_lock_Context               *lock_context
    266 ) RTEMS_NO_RETURN;
     266);
    267267
    268268/**
  • cpukit/include/rtems/test-info.h

    re1a0e0c3 rd7a48e1  
    111111 * pulls in stdio code
    112112 */
    113 void rtems_test_exit(int status) RTEMS_NO_RETURN;
     113RTEMS_NO_RETURN void rtems_test_exit(int status);
    114114
    115115/**
  • cpukit/score/cpu/aarch64/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    323323void _CPU_Context_switch( Context_Control *run, Context_Control *heir );
    324324
    325 void _CPU_Context_restore( Context_Control *new_context )
    326   RTEMS_NO_RETURN;
     325RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    327326
    328327#ifdef RTEMS_SMP
  • cpukit/score/cpu/arm/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    457457void _CPU_Context_switch( Context_Control *run, Context_Control *heir );
    458458
    459 void _CPU_Context_restore( Context_Control *new_context )
    460   RTEMS_NO_RETURN;
     459RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    461460
    462461#if defined(ARM_MULTILIB_ARCH_V7M)
    463   void _ARMV7M_Start_multitasking( Context_Control *heir )
    464     RTEMS_NO_RETURN;
     462  RTEMS_NO_RETURN void _ARMV7M_Start_multitasking( Context_Control *heir );
    465463  #define _CPU_Start_multitasking _ARMV7M_Start_multitasking
    466464#endif
  • cpukit/score/cpu/bfin/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    572572 * XXX document implementation including references if appropriate
    573573 */
    574 void _CPU_Context_restore(
    575   Context_Control *new_context
    576 ) RTEMS_NO_RETURN;
     574RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    577575
    578576/** @} */
  • cpukit/score/cpu/i386/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    497497 */
    498498
    499 extern void _CPU_Fatal_halt(uint32_t source, uint32_t error)
    500   RTEMS_NO_RETURN;
     499RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, uint32_t error );
    501500
    502501#endif /* ASM */
     
    583582 */
    584583
    585 void _CPU_Context_restore(
    586   Context_Control *new_context
    587 ) RTEMS_NO_RETURN;
     584RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    588585
    589586/*
  • cpukit/score/cpu/lm32/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    703703 * XXX document implementation including references if appropriate
    704704 */
    705 void _CPU_Context_restore(
    706   Context_Control *new_context
    707 ) RTEMS_NO_RETURN;
     705RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    708706
    709707/** @} */
  • cpukit/score/cpu/m68k/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    596596);
    597597
    598 void _CPU_Context_Restart_self(
     598RTEMS_NO_RETURN void _CPU_Context_Restart_self(
    599599  Context_Control  *the_context
    600 ) RTEMS_NO_RETURN;
     600);
    601601
    602602/*
  • cpukit/score/cpu/mips/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    775775 */
    776776
    777 void _CPU_Context_restore(
    778   Context_Control *new_context
    779 ) RTEMS_NO_RETURN;
     777RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    780778
    781779/*
  • cpukit/score/cpu/moxie/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    479479 *  XXX
    480480 */
    481 void _CPU_Context_restore(
    482   Context_Control *new_context
    483 ) RTEMS_NO_RETURN;
     481RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    484482
    485483/**
  • cpukit/score/cpu/nios2/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    291291  _CPU_Context_restore( (_the_context) );
    292292
    293 void _CPU_Fatal_halt( uint32_t _source, uint32_t _error )
    294   RTEMS_NO_RETURN;
     293RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t _source, uint32_t _error );
    295294
    296295/**
     
    311310void _CPU_Context_switch( Context_Control *run, Context_Control *heir );
    312311
    313 void _CPU_Context_restore(
    314   Context_Control *new_context
    315 ) RTEMS_NO_RETURN;
     312RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    316313
    317314void _CPU_Exception_frame_print( const CPU_Exception_frame *frame );
  • cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    10861086 * XXX document implementation including references if appropriate
    10871087 */
    1088 void _CPU_Context_restore(
    1089   Context_Control *new_context
    1090 ) RTEMS_NO_RETURN;
     1088RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    10911089
    10921090/**
  • cpukit/score/cpu/or1k/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    528528 */
    529529
    530 void _CPU_Context_restore(
    531   Context_Control *new_context
    532 ) RTEMS_NO_RETURN;
     530RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    533531
    534532/*
  • cpukit/score/cpu/powerpc/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    933933 */
    934934
    935 void _CPU_Context_restore(
    936   Context_Control *new_context
    937 ) RTEMS_NO_RETURN;
     935RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    938936
    939937/*
  • cpukit/score/cpu/riscv/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    214214   _CPU_Context_restore( (_the_context) )
    215215
    216 extern void _CPU_Fatal_halt(uint32_t source, uint32_t error) RTEMS_NO_RETURN;
     216RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, uint32_t error );
    217217
    218218#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
     
    394394 */
    395395
    396 void _CPU_Context_restore(
    397   Context_Control *new_context
    398 ) RTEMS_NO_RETURN;
     396RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    399397
    400398/*  The following routine swaps the endian format of an unsigned int.
  • cpukit/score/cpu/sh/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    587587 */
    588588
    589 void _CPU_Context_restore(
    590   Context_Control *new_context
    591 ) RTEMS_NO_RETURN;
     589RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    592590
    593591/*
  • cpukit/score/cpu/sparc/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    913913 * halts/stops the CPU.
    914914 */
    915 extern void _CPU_Fatal_halt(uint32_t source, uint32_t error)
    916   RTEMS_NO_RETURN;
     915RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, uint32_t error );
    917916
    918917/* end of Fatal Error manager macros */
     
    10021001 * @param[in] new_context is the context to restore
    10031002 */
    1004 void _CPU_Context_restore(
    1005   Context_Control *new_context
    1006 ) RTEMS_NO_RETURN;
     1003RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    10071004
    10081005#if defined(RTEMS_SMP)
  • cpukit/score/cpu/sparc/include/rtems/score/sparc.h

    re1a0e0c3 rd7a48e1  
    366366 * @param[in] exitcode2 Primary exit code stored in CPU g3 register after exit
    367367 */
    368 void sparc_syscall_exit(uint32_t exitcode1, uint32_t exitcode2)
    369   RTEMS_NO_RETURN;
     368RTEMS_NO_RETURN void sparc_syscall_exit(
     369  uint32_t exitcode1,
     370  uint32_t exitcode2
     371);
    370372
    371373/**
  • cpukit/score/cpu/sparc64/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    878878 */
    879879
    880 void _CPU_Context_restore(
    881   Context_Control *new_context
    882 ) RTEMS_NO_RETURN;
     880RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    883881
    884882/*
  • cpukit/score/cpu/v850/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    544544 * This is implemented in assembly on the v850.
    545545 */
    546 void _CPU_Context_restore(
    547   Context_Control *new_context
    548 ) RTEMS_NO_RETURN;
     546RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    549547
    550548/* XXX this should be possible to remove */
  • cpukit/score/cpu/x86_64/include/rtems/score/cpu.h

    re1a0e0c3 rd7a48e1  
    281281);
    282282
    283 void _CPU_Context_restore(
    284   Context_Control *new_context
    285 ) RTEMS_NO_RETURN;
     283RTEMS_NO_RETURN void _CPU_Context_restore( Context_Control *new_context );
    286284
    287285typedef struct {
Note: See TracChangeset for help on using the changeset viewer.