From 67da250615a22a0303fed416aa2c5c90c5b72078 Mon Sep 17 00:00:00 2001 From: Donn Date: Sun, 29 Jan 2023 01:06:22 +0200 Subject: [PATCH 1/2] Patches for Clang --- base/inetcomp.c | 1 + base/netcmp.c | 1 + base/test.c | 2 ++ base/verilog.c | 8 ++++---- netgen/inetcomp.c | 1 + netgen/netcomp.c | 1 + netgen/netgen_main.c | 1 + netgen/ntk2xnf.c | 2 ++ 8 files changed, 13 insertions(+), 4 deletions(-) diff --git a/base/inetcomp.c b/base/inetcomp.c index abf3a29..5941d2c 100644 --- a/base/inetcomp.c +++ b/base/inetcomp.c @@ -17,6 +17,7 @@ along with this program; see the file copying. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* inetcomp.c -- a simple wrapper to the NETCOMP() function */ +#include "config.h" #include #include "netgen.h" diff --git a/base/netcmp.c b/base/netcmp.c index 888382c..5fff026 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -17,6 +17,7 @@ along with this program; see the file copying. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* netcmp.c -- graph isomorphism testing */ +#include "config.h" #include "config.h" diff --git a/base/test.c b/base/test.c index f515be8..ac60e91 100644 --- a/base/test.c +++ b/base/test.c @@ -34,6 +34,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "print.h" #endif +extern void Finsert(FILE *f); + void test_entry(void) { diff --git a/base/verilog.c b/base/verilog.c index 4598b1c..07bdb9d 100644 --- a/base/verilog.c +++ b/base/verilog.c @@ -1588,13 +1588,13 @@ skip_endmodule: /* until bits in signal are exhausted or LHS is full. */ if (i != -1) - sprintf(nodename, "%s[%d]", noderoot, i); + snprintf(nodename, MAX_STR_LEN, "%s[%d]", noderoot, i); else - sprintf(nodename, lhs->name); + strncpy(nodename, MAX_STR_LEN, lhs->name); if (j != -1) - sprintf(assignname, "%s[%d]", assignroot, j); + snprintf(assignname, MAX_STR_LEN, "%s[%d]", assignroot, j); else - sprintf(assignname, rhs->name); + strncpy(assignname, MAX_STR_LEN, rhs->name); join(nodename, assignname); diff --git a/netgen/inetcomp.c b/netgen/inetcomp.c index abf3a29..5941d2c 100644 --- a/netgen/inetcomp.c +++ b/netgen/inetcomp.c @@ -17,6 +17,7 @@ along with this program; see the file copying. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* inetcomp.c -- a simple wrapper to the NETCOMP() function */ +#include "config.h" #include #include "netgen.h" diff --git a/netgen/netcomp.c b/netgen/netcomp.c index 9f9e659..aa38205 100644 --- a/netgen/netcomp.c +++ b/netgen/netcomp.c @@ -17,6 +17,7 @@ along with this program; see the file copying. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* netcomp.c -- a simple wrapper to provide netlist comparison functionality */ +#include "config.h" #include #include "netgen.h" diff --git a/netgen/netgen_main.c b/netgen/netgen_main.c index 47c5200..96118c4 100644 --- a/netgen/netgen_main.c +++ b/netgen/netgen_main.c @@ -23,6 +23,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include /* for getenv */ #endif #include "netgen.h" +#include "print.h" int main(int argc, char **argv) { diff --git a/netgen/ntk2xnf.c b/netgen/ntk2xnf.c index f2ac9e5..d5930d0 100644 --- a/netgen/ntk2xnf.c +++ b/netgen/ntk2xnf.c @@ -20,9 +20,11 @@ along with this program; see the file copying. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* ntk2xnf.c -- a simple wrapper to translate .ntk to Xilinx XNF format */ +#include "config.h" #include #include "netgen.h" +#include "xilinx.h" #ifdef HAVE_X11 /* the following two X procedures are to permit linking From e557e61a02f826864ef2b9a05ae0bb03b6c7cce7 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 28 Feb 2023 09:04:45 -0500 Subject: [PATCH 2/2] Updated version and fixed a redundant include statement after merging pull request #71 from Donn. --- VERSION | 2 +- base/netcmp.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 4595a7f..b588e7d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.246 +1.5.247 diff --git a/base/netcmp.c b/base/netcmp.c index 5fff026..af61c5d 100644 --- a/base/netcmp.c +++ b/base/netcmp.c @@ -19,8 +19,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* netcmp.c -- graph isomorphism testing */ #include "config.h" -#include "config.h" - #include #include /* for rand(), abs(), etc */ #include