From 3cb14683b032d2eadc559bb4c14212806f4a9a36 Mon Sep 17 00:00:00 2001 From: Tony Tung Date: Thu, 9 Jun 2016 22:45:05 -0700 Subject: [PATCH] [fastmanifest] enforce strict prototypes Summary: Newer versions of gcc (5.x) turn on `-Wstrict-prototype` by default. Turn this on in our setup.py file for older compilers, and fix the errors that crop up from this. Test Plan: make local Reviewers: tnardone, wez, lcharignon Reviewed By: lcharignon Subscribers: mitrandir, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D3414620 Signature: t1:3414620:1465514102:d91026062582e2a3ab3fc773bbf17686fa38609f --- cfastmanifest/tree.h | 2 +- cfastmanifest/tree_disk.c | 4 ++-- setup.py | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cfastmanifest/tree.h b/cfastmanifest/tree.h index f0b8a0ce0b..6fb2d41fec 100644 --- a/cfastmanifest/tree.h +++ b/cfastmanifest/tree.h @@ -59,7 +59,7 @@ typedef struct _iterator_t iterator_t; */ extern bool valid_path(const char *path, const size_t path_sz); -extern tree_t *alloc_tree(); +extern tree_t *alloc_tree(void); extern void destroy_tree(tree_t *tree); diff --git a/cfastmanifest/tree_disk.c b/cfastmanifest/tree_disk.c index d83b99f89d..841eb63ca9 100644 --- a/cfastmanifest/tree_disk.c +++ b/cfastmanifest/tree_disk.c @@ -62,7 +62,7 @@ typedef struct _v0_header_t { /** * Returns true iff the host is little endian. */ -static inline bool little_endian() { +static inline bool little_endian(void) { int foo = LITTLE_ENDIAN_TEST_VALUE; if (ntohl(foo) == LITTLE_ENDIAN_TEST_VALUE) { return false; @@ -74,7 +74,7 @@ static inline bool little_endian() { /** * Returns the size, in bytes, of the host pointer. */ -static inline uint8_t host_pointer_size() { +static inline uint8_t host_pointer_size(void) { return sizeof(void*); } diff --git a/setup.py b/setup.py index 3d39011352..f14629f8d8 100644 --- a/setup.py +++ b/setup.py @@ -85,7 +85,10 @@ setup( ], libraries=['crypto', ], - extra_compile_args=["-std=c99", "-Wall", "-Werror"], + extra_compile_args=[ + "-std=c99", + "-Wall", + "-Werror", "-Werror=strict-prototypes"], ) ], )