Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: reallocarr.c compile errors



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 28.07.2015 16:37, scole_mail wrote:
> On Tue, Jul 28, 2015 at 04:19:14PM +0200, Kamil Rytarowski wrote:
>> 
>> Please try to add: #if HAVE_NBTOOL_CONFIG_H #include
>> "nbtool_config.h" #endif
>> 
> 
> The first error went away but the CTASSERT remains:
> 
> #   compile  compat/reallocarr.lo cc -O  -I. -I./include
> -I/home/scole/nbsd/src/tools/compat
> -I/home/scole/nbsd/src/tools/compat/sys  -DHAVE_NBTOOL_CONFIG_H=1
> -D_FILE_OFFSET_BITS=64 -D__DBINTERFACE_PRIVATE -c -o
> reallocarr.lo.o
> /home/scole/nbsd/src/tools/compat/../../lib/libc/stdlib/reallocarr.c
>
> 
/home/scole/nbsd/src/tools/compat/../../lib/libc/stdlib/reallocarr.c:46:
12:
error: expected declaration specifiers or '...' before numeric constant
> __CTASSERT(65535 < SIZE_MAX / 65535);
> 
> Thanks
> 

And how about with the attached patch? I added a dummy __CTASSERT.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJVt5jEAAoJEEuzCOmwLnZsqCUQALxUzO/Ig/szEGT0o/48CC7Y
y8oc5HA9czuyIG+7hJ7l80ZhhvX4f626t+GrB1Vlg5lBuAIWmEnarzSKZd2lqc9k
IFJ+mcSuqJfj5zJ7/Uo5SxXRLhAbOz6GB0qtLPJvq0uHMSFOLMdpDU9SoecIzPP0
mlheEt8XJnlUP1tjxRJ4maNL4E5qxJ/OftF7jLpArD5exxBr25s4SaHOLzW7FQHs
XHmF5pjCdXWYod24QGbE1whLVYfWaHRXACaNT+Qq48VYFKWddiTH1DxszDFgd78s
Iyi/zw/H5UMaF9zVd6kYaFbs5g/PxBy45XvFMVsbyASPZ5nHtswwuCIRxE5m+7An
F0zdbA24IXIwPxnO8fVzhYgAmw/AOH+fFjIzVnphUmgIeM4Y7nDddQIE7JuAu9V6
XfV+GcDLfBmKXThnyQtnN6EDVTj6UlMbiuJ8jF7ONwB9tFCg6hoykWF+XYpmA4sE
r2y+XIbXyUgmMGrwBo0ubZnMFaUee5BR3sYzgmhYUWKEDI7ch6rjnOUYx7DTdh6c
AzvpzW6Z70KyIraSrKwWsws/Wn0dlEPICaW66/gwznNCn+gbU3QLDfct2doXma/u
SfE/Lewk3NXywIWRJsAklJQY5cz8nblfulZ88S76q89B19b9NgBq0i5w6eZbhKey
1Eoct0xkxCM0/yXMnsBr
=A/fq
-----END PGP SIGNATURE-----
Index: tools/compat/compat_defs.h
===================================================================
RCS file: /public/netbsd-rsync/src/tools/compat/compat_defs.h,v
retrieving revision 1.102
diff -u -r1.102 compat_defs.h
--- tools/compat/compat_defs.h	26 Jul 2015 14:01:53 -0000	1.102
+++ tools/compat/compat_defs.h	28 Jul 2015 14:47:00 -0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.102 2015/07/26 14:01:53 kamil Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.102 2015/07/26 13:45:33 kamil Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -73,6 +73,10 @@
 #endif
 
 /* Need this since we can't depend on NetBSD's version to be around */
+#ifdef __CTASSERT
+#undef __CTASSERT
+#endif
+#define __CTASSERT(x)
 #ifdef __UNCONST
 #undef __UNCONST
 #endif
Index: lib/libc/stdlib/reallocarr.c
===================================================================
RCS file: /public/netbsd-rsync/src/lib/libc/stdlib/reallocarr.c,v
retrieving revision 1.2
diff -u -r1.2 reallocarr.c
--- lib/libc/stdlib/reallocarr.c	16 Jul 2015 00:03:59 -0000	1.2
+++ lib/libc/stdlib/reallocarr.c	28 Jul 2015 14:31:55 -0000
@@ -29,6 +29,10 @@
  * SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include <sys/cdefs.h>
 __RCSID("$NetBSD: reallocarr.c,v 1.2 2015/07/16 00:03:59 kamil Exp $");
 
@@ -48,6 +52,7 @@
 #endif
 #endif
 
+#if !HAVE_REALLOCARR
 int
 reallocarr(void *ptr, size_t num, size_t size)
 {
@@ -76,3 +81,4 @@
 	errno = saved_errno;
 	return result;
 }
+#endif


Home | Main Index | Thread Index | Old Index