Hello Stuart,
Thanks for looking into this.
On 15/02/2020 - 15:09, Stuart Henderson wrote:
[...]
- Since we're already accepting that this code isn't C99 compliant, I
propose to clean-up a bit more the build log, adding
-Wno-implicit-function-declaration to CFLAG.
It's not just that it isn't C99 compliant, the missing declarations mean
that the wrong types are used for some of the calls. This can result in
some problems like pointers being truncated to 32 bits, it wouldn't
surprise me if some of these might result in crashes on 64-bit arches.
So I'd at least like to keep the warnings so it's easier for anyone
tracking down bugs, if not actually fix (maybe just some of) them.
Some already have declarations in headers and it just looks like the
#includes are missing (tclqrouter.c uses functions defined in output.h,
antenna.c uses some defined in mask.h and maze.h).
Others are only declared in the .c files where the function is defined
so declarations for those would need copying to a suitable header and
#including where necessary (or just copying declarations to the c files
where they're used, though headers are usually better).
So please find attached a diff with -Wno-implicit-function-declaration
removed.
Maybe it isn't a big effort to clean-up the code from those warnings,
I'll have a look and submit a PR upstream if I'm able to reach a
satisfying picture (but this will take time...)
All the best
--
Alessandro De Laurenzis
[mailto:[email protected]]
Web: http://www.atlantide.mooo.com
LinkedIn: http://it.linkedin.com/in/delaurenzis
Index: Makefile
===================================================================
RCS file: /cvs/ports/cad/qrouter/Makefile,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 Makefile
--- Makefile 8 Feb 2020 10:26:32 -0000 1.6
+++ Makefile 15 Feb 2020 16:56:14 -0000
@@ -1,8 +1,7 @@
# $OpenBSD: Makefile,v 1.6 2020/02/08 10:26:32 cwen Exp $
COMMENT = multi-level, over-the-cell maze router for VLSI design
-DISTNAME = qrouter-1.4.74
-REVISION = 0
+DISTNAME = qrouter-1.4.76
EXTRACT_SUFX = .tgz
CATEGORIES = cad
Index: distinfo
===================================================================
RCS file: /cvs/ports/cad/qrouter/distinfo,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 distinfo
--- distinfo 3 Feb 2020 22:21:57 -0000 1.4
+++ distinfo 15 Feb 2020 16:56:14 -0000
@@ -1,2 +1,2 @@
-SHA256 (qrouter-1.4.74.tgz) = zRGHPREv9HcAMKZGtyfwHZWFUj+0csDabcq+OV9gnPQ=
-SIZE (qrouter-1.4.74.tgz) = 326751
+SHA256 (qrouter-1.4.76.tgz) = KOCxnpXxuulPTW3DXIz9sJrkkZ0y7bBuYnVby7Klyqg=
+SIZE (qrouter-1.4.76.tgz) = 326888
Index: patches/patch-Makefile_in
===================================================================
RCS file: /cvs/ports/cad/qrouter/patches/patch-Makefile_in,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-Makefile_in
--- patches/patch-Makefile_in 3 Feb 2020 22:21:57 -0000 1.2
+++ patches/patch-Makefile_in 15 Feb 2020 16:56:14 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-Makefile_in,v 1.2 2020/0
Index: Makefile.in
--- Makefile.in.orig
+++ Makefile.in
-@@ -97,7 +97,8 @@ qrouternullg$(EXEEXT): $(OBJECTS4)
+@@ -98,7 +98,8 @@ qrouternullg$(EXEEXT): $(OBJECTS4)
$(RM) qrouternullg$(EXEEXT)
$(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} ${EXTRA_DEFS} \
${SOURCES4} ${INC_SPECS} -o $@ ${LIB_SPECS_NOSTUB} \
Index: patches/patch-configure_in
===================================================================
RCS file: patches/patch-configure_in
diff -N patches/patch-configure_in
--- patches/patch-configure_in 3 Feb 2020 22:21:57 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-$OpenBSD: patch-configure_in,v 1.2 2020/02/03 22:21:57 sthen Exp $
-
-Index: configure.in
---- configure.in.orig
-+++ configure.in
-@@ -861,7 +861,13 @@ if test $usingTcl ; then
- CFLAGS="${CFLAGS} -L/usr/X11R6/include"
- ;;
-
-- *-netbsd*|*-openbsd*)
-+ *-openbsd*)
-+ SHLIB_CFLAGS="-fpic"
-+ LDDL_FLAGS="-shared ${LIB_SPECS}"
-+ CFLAGS="${CFLAGS} -I${X11BASE}/include"
-+ ;;
-+
-+ *-netbsd*)
- # Not available on all versions: check for include file.
- AC_CHECK_HEADER(dlfcn.h, test_ok=yes, test_ok=no)
- if test "$test_ok" = yes; then
-@@ -885,7 +891,13 @@ if test $usingTcl ; then
- esac
- fi
- if test "$with_gnu_ld" = "yes" ; then
-- LDDL_FLAGS="${LDDL_FLAGS} -Wl,--version-script=symbol.map"
-+ case $target in
-+ *-openbsd*)
-+ ;;
-+ *)
-+ LDDL_FLAGS="${LDDL_FLAGS} -Wl,--version-script=symbol.map"
-+ ;;
-+ esac
- fi
-
- AC_SUBST(SHDLIB_EXT)
Index: patches/patch-qrouter_h
===================================================================
RCS file: patches/patch-qrouter_h
diff -N patches/patch-qrouter_h
--- patches/patch-qrouter_h 8 Feb 2020 10:26:32 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-$OpenBSD: patch-qrouter_h,v 1.3 2020/02/08 10:26:32 cwen Exp $
-
-Index: qrouter.h
---- qrouter.h.orig
-+++ qrouter.h
-@@ -40,7 +40,7 @@ typedef unsigned long u_long;
- #endif /* _SYS_TYPES_H */
-
- /* Compare functions aren't defined in the Mac's standard library */
--#if defined(__APPLE__) || defined(__FreeBSD__)
-+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
- typedef int (*__compar_fn_t)(const void*, const void*);
- #endif
-
-@@ -530,6 +530,8 @@ NET getnettoroute(int order);
- int route_net_ripup(NET net, u_char graphdebug, u_char onlybreak);
-
- #ifdef TCL_QROUTER
-+/* XXX needed for va_list with GCC */
-+#include <stdarg.h>
- void tcl_printf(FILE *, const char *, ...);
- void tcl_stdflush(FILE *);
- void tcl_vprintf(FILE *, const char *, va_list);