Commit 74538386 authored by Niels Möller's avatar Niels Möller

Improved use of gcc __attribute__.

parent 6ad4d518
2012-09-07 Niels Möller <nisse@lysator.liu.se>
* examples/nettle-benchmark.c (die): Add NORETURN attribute. Patch
from Tim Rühsen.
* tools/misc.h (die, werror): Use PRINTF_STYLE and NORETURN macros
for attributes. Patch from Tim Rühsen.
* examples/io.h (werror): Use PRINTF_STYLE macro.
2012-08-22 Niels Möller <nisse@lysator.liu.se> 2012-08-22 Niels Möller <nisse@lysator.liu.se>
From Sam Thursfield <sam.thursfield@codethink.co.uk>: From Sam Thursfield <sam.thursfield@codethink.co.uk>:
......
...@@ -37,11 +37,7 @@ void * ...@@ -37,11 +37,7 @@ void *
xalloc(size_t size); xalloc(size_t size);
void void
werror(const char *format, ...) werror(const char *format, ...) PRINTF_STYLE(1, 2);
#if __GNUC___
__attribute__((__format__ (__printf__,1, 2)))
#endif
;
/* If size is > 0, read at most that many bytes. If size == 0, /* If size is > 0, read at most that many bytes. If size == 0,
* read until EOF. Allocates the buffer dynamically. */ * read until EOF. Allocates the buffer dynamically. */
......
...@@ -96,7 +96,7 @@ static double frequency = 0.0; ...@@ -96,7 +96,7 @@ static double frequency = 0.0;
#define BENCH_ITERATIONS 10 #define BENCH_ITERATIONS 10
#endif #endif
static void static void NORETURN
die(const char *format, ...) die(const char *format, ...)
{ {
va_list args; va_list args;
......
...@@ -28,19 +28,10 @@ ...@@ -28,19 +28,10 @@
#endif #endif
void void
die(const char *format, ...) die(const char *format, ...) PRINTF_STYLE (1, 2) NORETURN;
#if __GNUC___
__attribute__((__format__ (__printf__,1, 2)))
__attribute__((__noreturn__))
#endif
;
void void
werror(const char *format, ...) werror(const char *format, ...) PRINTF_STYLE (1, 2);
#if __GNUC___
__attribute__((__format__ (__printf__,1, 2)))
#endif
;
void * void *
xalloc(size_t size); xalloc(size_t size);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment