Changeset bf61d3a in mainline for boot/generic/include


Ignore:
Timestamp:
2010-11-26T01:34:21Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
273b958
Parents:
4b9a410 (diff), 7e752b2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge compile-time printf() argument checking, fixes of actual printf() arguments and related modifications

Location:
boot/generic/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • boot/generic/include/printf.h

    r4b9a410 rbf61d3a  
    3636#include <stdarg.h>
    3737
     38#ifndef NVERIFY_PRINTF
     39
     40#define PRINTF_ATTRIBUTE(start, end) \
     41        __attribute__((format(gnu_printf, start, end)))
     42
     43#else /* NVERIFY_PRINTF */
     44
     45#define PRINTF_ATTRIBUTE(start, end)
     46
     47#endif /* NVERIFY_PRINTF */
     48
    3849#define EOF  (-1)
    3950
    4051extern int puts(const char *);
    41 extern int printf(const char *, ...);
     52extern int printf(const char *, ...)
     53    PRINTF_ATTRIBUTE(1, 2);
    4254extern int vprintf(const char *, va_list);
    4355
  • boot/generic/include/stdint.h

    r4b9a410 rbf61d3a  
    3333#define BOOT_STDINT_H_
    3434
    35 #define INT8_MIN  (0x80)
    36 #define INT8_MAX  (0x7F)
     35#define INT8_MIN  INT8_C(0x80)
     36#define INT8_MAX  INT8_C(0x7F)
    3737
    38 #define UINT8_MIN  (0u)
    39 #define UINT8_MAX  (0xFFu)
     38#define UINT8_MIN  UINT8_C(0)
     39#define UINT8_MAX  UINT8_C(0xFF)
    4040
    41 #define INT16_MIN  (0x8000)
    42 #define INT16_MAX  (0x7FFF)
     41#define INT16_MIN  INT16_C(0x8000)
     42#define INT16_MAX  INT16_C(0x7FFF)
    4343
    44 #define UINT16_MIN  (0u)
    45 #define UINT16_MAX  (0xFFFFu)
     44#define UINT16_MIN  UINT16_C(0)
     45#define UINT16_MAX  UINT16_C(0xFFFF)
    4646
    47 #define INT32_MIN  (0x80000000l)
    48 #define INT32_MAX  (0x7FFFFFFFl)
     47#define INT32_MIN  INT32_C(0x80000000)
     48#define INT32_MAX  INT32_C(0x7FFFFFFF)
    4949
    50 #define UINT32_MIN  (0ul)
    51 #define UINT32_MAX  (0xFFFFFFFFul)
     50#define UINT32_MIN  UINT32_C(0)
     51#define UINT32_MAX  UINT32_C(0xFFFFFFFF)
    5252
    53 #define INT64_MIN  (0x8000000000000000ll)
    54 #define INT64_MAX  (0x7FFFFFFFFFFFFFFFll)
     53#define INT64_MIN  INT64_C(0x8000000000000000)
     54#define INT64_MAX  INT64_C(0x7FFFFFFFFFFFFFFF)
    5555
    56 #define UINT64_MIN  (0ull)
    57 #define UINT64_MAX  (0xFFFFFFFFFFFFFFFFull)
     56#define UINT64_MIN  UINT64_C(0)
     57#define UINT64_MAX  UINT64_C(0xFFFFFFFFFFFFFFFF)
    5858
    5959#endif
  • boot/generic/include/typedefs.h

    r4b9a410 rbf61d3a  
    3737#include <arch/types.h>
    3838
    39 #define NULL    ((void *) 0)
     39#define NULL  ((void *) 0)
    4040
    4141#define false  0
     
    4343
    4444typedef uint8_t bool;
    45 typedef int32_t wchar_t;
    4645
    4746#endif
Note: See TracChangeset for help on using the changeset viewer.