Changeset e8020d1 in rtems


Ignore:
Timestamp:
Jun 21, 2016, 11:28:01 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
ede1a41
Parents:
5c370a5d
git-author:
Sebastian Huber <sebastian.huber@…> (06/21/16 11:28:01)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/22/16 05:29:26)
Message:

Rename and move RTEMS_PRINTF_ATTRIBUTE()

Rename RTEMS_PRINTF_ATTRIBUTE() into RTEMS_PRINTFLIKE() (similar to
<sys/cdefs.h> printflike()) and move it to <rtems/score/basedefs.h>.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/bspIo.h

    r5c370a5d re8020d1  
    1919#define _RTEMS_BSPIO_H
    2020
     21#include <rtems/score/basedefs.h>
     22
     23#include <stdarg.h>
     24
    2125#ifdef __cplusplus
    2226extern "C" {
     
    3640 *  - BSP_poll_char
    3741 */
    38 
    39 /**
    40  * Print format function attribute for warning checks. Can be defined if
    41  * checking needs to be disabled.
    42  */
    43 #ifndef RTEMS_PRINTF_ATTRIBUTE
    44 #define RTEMS_PRINTF_ATTRIBUTE(_format_pos, _ap_pos) \
    45   __attribute__((format(__printf__, _format_pos, _ap_pos)))
    46 #endif
    4742
    4843/**
     
    6964 */
    7065extern  BSP_polling_getchar_function_type       BSP_poll_char;
    71 
    72 #include <stdarg.h>
    7366
    7467/**
     
    108101 * @return The number of characters output.
    109102 */
    110 extern int printk(const char *fmt, ...) RTEMS_PRINTF_ATTRIBUTE(1, 2);
     103extern int printk(const char *fmt, ...) RTEMS_PRINTFLIKE(1, 2);
    111104
    112105/**
  • cpukit/include/rtems/print.h

    r5c370a5d re8020d1  
    6969extern int rtems_printf(const rtems_printer *printer,
    7070                        const char          *format,
    71                         ...) RTEMS_PRINTF_ATTRIBUTE(2, 3);
     71                        ...) RTEMS_PRINTFLIKE(2, 3);
    7272
    7373/**
  • cpukit/libmisc/testsupport/test.h

    r5c370a5d re8020d1  
    8787 * @returns As specified by printf().
    8888 */
    89 int rtems_test_print(const char* format, ...) RTEMS_PRINTF_ATTRIBUTE(1, 2);
     89int rtems_test_print(const char* format, ...) RTEMS_PRINTFLIKE(1, 2);
    9090
    9191/**
  • cpukit/score/include/rtems/score/basedefs.h

    r5c370a5d re8020d1  
    209209#else
    210210  #define RTEMS_UNREACHABLE() _Assert_Unreachable()
     211#endif
     212
     213/**
     214 * @brief Tells the compiler that this function expects printf()-like
     215 * arguments.
     216 */
     217#if defined(__GNUC__)
     218  #define RTEMS_PRINTFLIKE( _format_pos, _ap_pos ) \
     219    __attribute__((__format__(__printf__, _format_pos, _ap_pos)))
     220#else
     221  #define RTEMS_PRINTFLIKE( _format_pos, _ap_pos )
    211222#endif
    212223
  • testsuites/sptests/spprintk/init.c

    r5c370a5d re8020d1  
    1414#endif
    1515
     16#include <rtems/score/basedefs.h>
     17
    1618/*
    17  * Undefined the RTEMS_PRINTF_ATTRIBUTE and make it nothing. The test code
     19 * Undefined the RTEMS_PRINTFLIKE and make it nothing. The test code
    1820 * contained in the file is suppose to be wrong.
    1921 */
    20 #undef RTEMS_PRINTF_ATTRIBUTE
    21 #define RTEMS_PRINTF_ATTRIBUTE(_a, _b)
     22#undef RTEMS_PRINTFLIKE
     23#define RTEMS_PRINTFLIKE(_a, _b)
    2224
    2325#define TESTS_USE_PRINTK
Note: See TracChangeset for help on using the changeset viewer.