diff options
author | Timo Sirainen <tss@iki.fi> | 2005-08-09 18:30:22 +0300 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-08-09 22:28:19 -0700 |
commit | 4ec99bf080f2d95c7c3d706f65eea1c6b9302f23 (patch) | |
tree | d4645413f012a970eb7744004fe829aa2786a067 /cache.h | |
parent | 96ad15ae2ff6416cf04c4c75a11783632cdc8fb4 (diff) | |
download | git-4ec99bf080f2d95c7c3d706f65eea1c6b9302f23.tar.gz git-4ec99bf080f2d95c7c3d706f65eea1c6b9302f23.tar.xz |
[PATCH] -Werror fixes
GCC's format __attribute__ is good for checking errors, especially
with -Wformat=2 parameter. This fixes most of the reported problems
against 2005-08-09 snapshot.
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -40,6 +40,10 @@ #define NORETURN #endif +#ifndef __attribute__ +#define __attribute(x) +#endif + /* * Intensive research over the course of many years has shown that * port 9418 is totally unused by anything else. Or @@ -171,8 +175,8 @@ extern void rollback_index_file(struct cache_file *); #define TYPE_CHANGED 0x0040 /* Return a statically allocated filename matching the sha1 signature */ -extern char *mkpath(const char *fmt, ...); -extern char *git_path(const char *fmt, ...); +extern char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2))); +extern char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2))); extern char *sha1_file_name(const unsigned char *sha1); extern char *sha1_pack_name(const unsigned char *sha1); extern char *sha1_pack_index_name(const unsigned char *sha1); @@ -218,8 +222,8 @@ extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */ /* General helper functions */ extern void usage(const char *err) NORETURN; -extern void die(const char *err, ...) NORETURN; -extern int error(const char *err, ...); +extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2))); +extern int error(const char *err, ...) __attribute__((format (printf, 1, 2))); extern int base_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2); extern int cache_name_compare(const char *name1, int len1, const char *name2, int len2); |