Add printf checking
This commit is contained in:
parent
06e247a401
commit
91e2e76c91
@ -59,7 +59,8 @@ env.Append(CFLAGS = [ "-Wshadow", "-Wno-typedef-redefinition" ])
|
||||
#env.Append(CXXFLAGS = [ "-Wno-non-template-friend", "-Woverloaded-virtual",
|
||||
# "-Wcast-qual", "-Wcast-align", "-Wconversion",
|
||||
# "-Weffc++", "-std=c++0x", "-Werror" ])
|
||||
env.Append(CPPFLAGS = [ "-fno-builtin", "-fno-stack-protector" ])
|
||||
env.Append(CPPFLAGS = [ "-fno-builtin", "-fno-stack-protector",
|
||||
"-Wformat=2", "-Wmissing-format-attribute" ])
|
||||
|
||||
if env["WITH_GPROF"] == "1":
|
||||
env.Append(CPPFLAGS = [ "-pg" ])
|
||||
|
@ -3,6 +3,7 @@
|
||||
#define __STDIO_H__
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
typedef struct FILE {
|
||||
int in_use;
|
||||
@ -40,7 +41,7 @@ int puts(const char *str);
|
||||
int printf(const char *fmt, ...);
|
||||
int fprintf(FILE *stream, const char *fmt, ...);
|
||||
int sprintf(char *str, const char *fmt, ...);
|
||||
int snprintf(char *str, size_t size, const char *fmt, ...);
|
||||
int snprintf(char *str, size_t size, const char *fmt, ...) __printflike(3, 4);;
|
||||
|
||||
#endif /* __STDIO_H__ */
|
||||
|
||||
|
@ -16,5 +16,7 @@
|
||||
|
||||
#define __hidden __attribute__((__visibility__("hidden")))
|
||||
|
||||
#define __printflike(_fmt, _var) __attribute__((__format__(__printf__, _fmt, _var)))
|
||||
|
||||
#endif /* __CDEFS_H__ */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user