Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Catch future printf() mistakes.
  • Loading branch information
icculus committed Oct 11, 2009
1 parent 1b0e087 commit 87dd0f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion utils/fatelf-utils.h
Expand Up @@ -24,6 +24,12 @@
#error Do not include this file outside of FatELF.
#endif

#ifdef __GNUC__
#define FATELF_ISPRINTF(x,y) __attribute__((format (printf, x, y)))
#else
#define FATELF_ISPRINTF(x,y)
#endif

extern const char *unlink_on_xfail;
extern const char *fatelf_build_version;

Expand Down Expand Up @@ -53,7 +59,7 @@ typedef struct fatelf_osabi_info
// all functions that start with 'x' may call exit() on error!

// Report an error to stderr and terminate immediately with exit(1).
void xfail(const char *fmt, ...);
void xfail(const char *fmt, ...) FATELF_ISPRINTF(1,2);

// Wrap malloc() with an xfail(), so this returns memory or calls exit().
// Memory is guaranteed to be initialized to zero.
Expand Down

0 comments on commit 87dd0f5

Please sign in to comment.