From fc7e7640ed3853fb1c1bc98ead33ab6a12549a99 Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 5 Jan 2012 17:24:37 -0800 Subject: [PATCH] Remove some MinGW32-w64 compile warnings. --- ivlpp/Makefile.in | 2 +- libveriuser/Makefile.in | 3 +-- netlist.cc | 4 ++-- tgt-vhdl/cast.cc | 3 ++- tgt-vhdl/vhdl_helper.hh | 3 ++- tgt-vvp/eval_expr.c | 10 +++++----- tgt-vvp/eval_real.c | 3 ++- vpi/Makefile.in | 6 +++--- vpi/sys_queue.c | 4 ++-- vvp/config.h.in | 8 +++++++- 10 files changed, 27 insertions(+), 19 deletions(-) diff --git a/ivlpp/Makefile.in b/ivlpp/Makefile.in index 226d5fb51..44b800e4b 100644 --- a/ivlpp/Makefile.in +++ b/ivlpp/Makefile.in @@ -70,7 +70,7 @@ ivlpp@EXEEXT@: $O $(CC) $(LDFLAGS) $O -o ivlpp@EXEEXT@ @EXTRALIBS@ lexor.c: $(srcdir)/lexor.lex - $(LEX) -s -t $< > $@ + $(LEX) -t $< > $@ install: all installdirs $(libdir)/ivl$(suffix)/ivlpp@EXEEXT@ diff --git a/libveriuser/Makefile.in b/libveriuser/Makefile.in index dc8bf3f46..557c12fa0 100644 --- a/libveriuser/Makefile.in +++ b/libveriuser/Makefile.in @@ -46,7 +46,6 @@ endif CPPFLAGS = $(INCLUDE_PATH) @CPPFLAGS@ @DEFS@ @PICFLAG@ CFLAGS = @WARNING_FLAGS@ @CFLAGS@ -LDFLAGS = @LDFLAGS@ A = a_close.o a_compare_handles.o a_configure.o a_fetch_argc.o \ a_fetch_argv.o a_fetch_dir.o a_fetch_fullname.o a_fetch_location.o \ @@ -88,7 +87,7 @@ stamp-config-h: $(srcdir)/config.h.in ../config.status config.h: stamp-config-h libveriuser.o: $O - $(LD) $(LDFLAGS) -r -o $@ $O + $(LD) -r -o $@ $O libveriuser.a: libveriuser.o rm -f $@ diff --git a/netlist.cc b/netlist.cc index d0aad7adf..8d8e9af9a 100644 --- a/netlist.cc +++ b/netlist.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2011 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2012 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -2429,7 +2429,7 @@ NetECast::~NetECast() ivl_variable_type_t NetECast::expr_type() const { - ivl_variable_type_t ret; + ivl_variable_type_t ret = IVL_VT_NO_TYPE; switch (op_) { case 'v': ret = IVL_VT_LOGIC; diff --git a/tgt-vhdl/cast.cc b/tgt-vhdl/cast.cc index f54dacf94..11dd34eb5 100644 --- a/tgt-vhdl/cast.cc +++ b/tgt-vhdl/cast.cc @@ -1,7 +1,7 @@ /* * Generate code to convert between VHDL types. * - * Copyright (C) 2008-2009 Nick Gasson (nick@nickg.me.uk) + * Copyright (C) 2008-2012 Nick Gasson (nick@nickg.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -219,6 +219,7 @@ vhdl_expr *vhdl_expr::to_std_ulogic() } else assert(false); + return NULL; } /* diff --git a/tgt-vhdl/vhdl_helper.hh b/tgt-vhdl/vhdl_helper.hh index 814c5369d..d801f190b 100644 --- a/tgt-vhdl/vhdl_helper.hh +++ b/tgt-vhdl/vhdl_helper.hh @@ -1,7 +1,7 @@ /* * Helper functions for VHDL syntax elements. * - * Copyright (C) 2008-2010 Nick Gasson (nick@nickg.me.uk) + * Copyright (C) 2008-2012 Nick Gasson (nick@nickg.me.uk) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,6 +64,7 @@ static inline char vl_to_vhdl_bit(char bit) return '-'; } assert(false); + return 0; } #endif diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index 5af817e48..3e7b548d0 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -2924,8 +2924,8 @@ static struct vector_info draw_sfunc_expr(ivl_expr_t expr, unsigned wid) static struct vector_info increment(ivl_expr_t e, unsigned wid, bool pre) { - ivl_signal_t s; - unsigned w; + ivl_signal_t s = 0; + unsigned w = 0; struct vector_info r; struct vector_info rc; @@ -3000,8 +3000,8 @@ static inline struct vector_info post_increment(ivl_expr_t e, unsigned wid) static struct vector_info decrement(ivl_expr_t e, unsigned wid, bool pre) { - ivl_signal_t s; - unsigned w; + ivl_signal_t s = 0; + unsigned w = 0; struct vector_info r; struct vector_info rc; diff --git a/tgt-vvp/eval_real.c b/tgt-vvp/eval_real.c index ce8c10d22..56fb2fe7b 100644 --- a/tgt-vvp/eval_real.c +++ b/tgt-vvp/eval_real.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2011 Stephen Williams (steve@icarus.com) + * Copyright (c) 2003-2012 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -590,6 +590,7 @@ static int draw_unary_real(ivl_expr_t expr) fprintf(stderr, "vvp.tgt error: unhandled real unary operator: %c.\n", ivl_expr_opcode(expr)); assert(0); + return 0; } int draw_eval_real(ivl_expr_t expr) diff --git a/vpi/Makefile.in b/vpi/Makefile.in index 7ce19bd14..a0aa48993 100644 --- a/vpi/Makefile.in +++ b/vpi/Makefile.in @@ -125,12 +125,12 @@ system.vpi: $O $(OPP) ../vvp/libvpi.a $(CXX) @shared@ -o $@ $O $(OPP) -L../vvp $(LDFLAGS) -lvpi $(SYSTEM_VPI_LDFLAGS) sys_readmem_lex.c: $(srcdir)/sys_readmem_lex.lex - $(LEX) -s -t $< > $@ + $(LEX) -t $< > $@ sdf_lexor.o: sdf_lexor.c sdf_parse.h sdf_lexor.c: $(srcdir)/sdf_lexor.lex - $(LEX) -s -t $< > $@ + $(LEX) -t $< > $@ # Build this in two steps to avoid parallel build issues (see pr3462585) sdf_parse.c: $(srcdir)/sdf_parse.y @@ -140,7 +140,7 @@ sdf_parse.h: sdf_parse.c table_mod_lexor.o: table_mod_lexor.c table_mod_parse.h table_mod_lexor.c: $(srcdir)/table_mod_lexor.lex - $(LEX) -s -t $< > $@ + $(LEX) -t $< > $@ # Build this in two steps to avoid parallel build issues (see pr3462585) table_mod_parse.c: $(srcdir)/table_mod_parse.y diff --git a/vpi/sys_queue.c b/vpi/sys_queue.c index c45fb63ec..4f1dc0e25 100644 --- a/vpi/sys_queue.c +++ b/vpi/sys_queue.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Cary R. (cygcary@yahoo.com) + * Copyright (C) 2011-2012 Cary R. (cygcary@yahoo.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -587,7 +587,7 @@ static unsigned check_numeric_args(vpiHandle argv, unsigned count, /* Check that the first count arguments are numeric. Currently * only three are needed/supported. */ for (idx = 0; idx < count; idx += 1) { - char *loc; + char *loc = NULL; vpiHandle arg = vpi_scan(argv); /* Get the name for this argument. */ diff --git a/vvp/config.h.in b/vvp/config.h.in index f945cfa03..4c19d788f 100644 --- a/vvp/config.h.in +++ b/vvp/config.h.in @@ -1,7 +1,7 @@ #ifndef __config_H #define __config_H /* - * Copyright (c) 2001-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -86,9 +86,15 @@ typedef uint64_t vvp_time64_t; +#ifdef __MINGW32__ +# define TIME_FMT_O "I64o" +# define TIME_FMT_U "I64u" +# define TIME_FMT_X "I64x" +#else # define TIME_FMT_O PRIo64 # define TIME_FMT_U PRIu64 # define TIME_FMT_X PRIx64 +#endif # if UINT64_T_AND_ULONG_SAME # define UL_AND_TIME64_SAME