Add -Wstrict-prototypes option

pull/13171/head
Esun Kim 6 years ago
parent 76d75aec66
commit 2c3a28e411
  1. 1
      BUILD
  2. 2
      generated_for_cmake/upb/json/parser.c
  3. 4
      tests/conformance_upb.c
  4. 2
      tests/pb/test_varint.c
  5. 2
      upb/def.c
  6. 2
      upb/def.h
  7. 2
      upb/json/parser.h
  8. 2
      upb/json/parser.rl
  9. 2
      upb/legacy_msg_reflection.c
  10. 2
      upb/legacy_msg_reflection.h
  11. 2
      upb/pb/compile_decoder.c
  12. 2
      upb/pb/encoder.c
  13. 2
      upb/pb/encoder.h
  14. 2
      upb/pb/textprinter.c
  15. 2
      upb/pb/textprinter.h
  16. 4
      upb/upb.h

@ -33,6 +33,7 @@ COPTS = CPPOPTS + [
# copybara:strip_for_google3_begin # copybara:strip_for_google3_begin
"-pedantic", "-pedantic",
"-std=c89", "-std=c89",
"-Wstrict-prototypes",
# copybara:strip_end # copybara:strip_end
] ]

@ -3395,7 +3395,7 @@ const upb_byteshandler *upb_json_parsermethod_inputhandler(
return &m->input_handler_; return &m->input_handler_;
} }
upb_json_codecache *upb_json_codecache_new() { upb_json_codecache *upb_json_codecache_new(void) {
upb_alloc *alloc; upb_alloc *alloc;
upb_json_codecache *c; upb_json_codecache *c;

@ -119,7 +119,7 @@ void DoTest(
return; return;
} }
bool DoTestIo() { bool DoTestIo(void) {
upb_arena *arena; upb_arena *arena;
upb_alloc *alloc; upb_alloc *alloc;
upb_status status; upb_status status;
@ -168,7 +168,7 @@ bool DoTestIo() {
return true; return true;
} }
int main() { int main(void) {
while (1) { while (1) {
if (!DoTestIo()) { if (!DoTestIo()) {
fprintf(stderr, "conformance_upb: received EOF from test runner " fprintf(stderr, "conformance_upb: received EOF from test runner "

@ -101,7 +101,7 @@ static void test_varint_decoder(upb_decoderet (*decoder)(const char*)) {
upb_decoderet _upb_vdecode_ ## decoder(const char *p) { \ upb_decoderet _upb_vdecode_ ## decoder(const char *p) { \
return upb_vdecode_ ## decoder(p); \ return upb_vdecode_ ## decoder(p); \
} \ } \
void test_ ## decoder() { \ void test_ ## decoder(void) { \
test_varint_decoder(&_upb_vdecode_ ## decoder); \ test_varint_decoder(&_upb_vdecode_ ## decoder); \
} \ } \

@ -1633,7 +1633,7 @@ void upb_symtab_free(upb_symtab *s) {
upb_gfree(s); upb_gfree(s);
} }
upb_symtab *upb_symtab_new() { upb_symtab *upb_symtab_new(void) {
upb_symtab *s = upb_gmalloc(sizeof(*s)); upb_symtab *s = upb_gmalloc(sizeof(*s));
upb_alloc *alloc; upb_alloc *alloc;

@ -837,7 +837,7 @@ class upb::FileDefPtr {
extern "C" { extern "C" {
#endif #endif
upb_symtab *upb_symtab_new(); upb_symtab *upb_symtab_new(void);
void upb_symtab_free(upb_symtab* s); void upb_symtab_free(upb_symtab* s);
const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym); const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym);
const upb_msgdef *upb_symtab_lookupmsg2( const upb_msgdef *upb_symtab_lookupmsg2(

@ -113,7 +113,7 @@ typedef struct upb_json_codecache upb_json_codecache;
extern "C" { extern "C" {
#endif #endif
upb_json_codecache *upb_json_codecache_new(); upb_json_codecache *upb_json_codecache_new(void);
void upb_json_codecache_free(upb_json_codecache *cache); void upb_json_codecache_free(upb_json_codecache *cache);
const upb_json_parsermethod* upb_json_codecache_get(upb_json_codecache* cache, const upb_json_parsermethod* upb_json_codecache_get(upb_json_codecache* cache,
const upb_msgdef* md); const upb_msgdef* md);

@ -2958,7 +2958,7 @@ const upb_byteshandler *upb_json_parsermethod_inputhandler(
return &m->input_handler_; return &m->input_handler_;
} }
upb_json_codecache *upb_json_codecache_new() { upb_json_codecache *upb_json_codecache_new(void) {
upb_alloc *alloc; upb_alloc *alloc;
upb_json_codecache *c; upb_json_codecache *c;

@ -349,7 +349,7 @@ struct upb_mapiter {
upb_fieldtype_t key_type; upb_fieldtype_t key_type;
}; };
size_t upb_mapiter_sizeof() { size_t upb_mapiter_sizeof(void) {
return sizeof(upb_mapiter); return sizeof(upb_mapiter);
} }

@ -173,7 +173,7 @@ bool upb_map_del(upb_map *map, upb_msgval key);
* and if you keep invalidating the iterator during iteration, the program may * and if you keep invalidating the iterator during iteration, the program may
* enter an infinite loop. */ * enter an infinite loop. */
size_t upb_mapiter_sizeof(); size_t upb_mapiter_sizeof(void);
void upb_mapiter_begin(upb_mapiter *i, const upb_map *t); void upb_mapiter_begin(upb_mapiter *i, const upb_map *t);
upb_mapiter *upb_mapiter_new(const upb_map *t, upb_alloc *a); upb_mapiter *upb_mapiter_new(const upb_map *t, upb_alloc *a);

@ -69,7 +69,7 @@ static void freegroup(mgroup *g) {
upb_gfree(g); upb_gfree(g);
} }
mgroup *newgroup() { mgroup *newgroup(void) {
mgroup *g = upb_gmalloc(sizeof(*g)); mgroup *g = upb_gmalloc(sizeof(*g));
upb_inttable_init(&g->methods, UPB_CTYPE_PTR); upb_inttable_init(&g->methods, UPB_CTYPE_PTR);
g->bytecode = NULL; g->bytecode = NULL;

@ -524,7 +524,7 @@ void upb_pb_encoder_reset(upb_pb_encoder *e) {
/* public API *****************************************************************/ /* public API *****************************************************************/
upb_handlercache *upb_pb_encoder_newcache() { upb_handlercache *upb_pb_encoder_newcache(void) {
return upb_handlercache_new(newhandlers_callback, NULL); return upb_handlercache_new(newhandlers_callback, NULL);
} }

@ -45,7 +45,7 @@ upb_pb_encoder* upb_pb_encoder_create(upb_arena* a, const upb_handlers* h,
/* Lazily builds and caches handlers that will push encoded data to a bytessink. /* Lazily builds and caches handlers that will push encoded data to a bytessink.
* Any msgdef objects used with this object must outlive it. */ * Any msgdef objects used with this object must outlive it. */
upb_handlercache *upb_pb_encoder_newcache(); upb_handlercache *upb_pb_encoder_newcache(void);
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" { */ } /* extern "C" { */

@ -329,7 +329,7 @@ upb_textprinter *upb_textprinter_create(upb_arena *arena, const upb_handlers *h,
return p; return p;
} }
upb_handlercache *upb_textprinter_newcache() { upb_handlercache *upb_textprinter_newcache(void) {
return upb_handlercache_new(&onmreg, NULL); return upb_handlercache_new(&onmreg, NULL);
} }

@ -31,7 +31,7 @@ upb_textprinter *upb_textprinter_create(upb_arena *arena, const upb_handlers *h,
upb_bytessink output); upb_bytessink output);
void upb_textprinter_setsingleline(upb_textprinter *p, bool single_line); void upb_textprinter_setsingleline(upb_textprinter *p, bool single_line);
upb_sink upb_textprinter_input(upb_textprinter *p); upb_sink upb_textprinter_input(upb_textprinter *p);
upb_handlercache *upb_textprinter_newcache(); upb_handlercache *upb_textprinter_newcache(void);
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */

@ -222,7 +222,7 @@ UPB_INLINE void *upb_arena_realloc(upb_arena *a, void *ptr, size_t oldsize,
return upb_realloc(upb_arena_alloc(a), ptr, oldsize, size); return upb_realloc(upb_arena_alloc(a), ptr, oldsize, size);
} }
UPB_INLINE upb_arena *upb_arena_new() { UPB_INLINE upb_arena *upb_arena_new(void) {
return upb_arena_init(NULL, 0, &upb_alloc_global); return upb_arena_init(NULL, 0, &upb_alloc_global);
} }
@ -287,7 +287,7 @@ template <int N> class upb::InlinedArena : public upb::Arena {
/* Constants ******************************************************************/ /* Constants ******************************************************************/
/* Generic function type. */ /* Generic function type. */
typedef void upb_func(); typedef void upb_func(void);
/* A list of types as they are encoded on-the-wire. */ /* A list of types as they are encoded on-the-wire. */
typedef enum { typedef enum {

Loading…
Cancel
Save