Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src various build fixes for gcc 4.5. from chuq. XXX i'm not su...
details: https://anonhg.NetBSD.org/src/rev/6e2b7634bc2b
branches: trunk
changeset: 766295:6e2b7634bc2b
user: mrg <mrg%NetBSD.org@localhost>
date: Mon Jun 20 09:11:16 2011 +0000
description:
various build fixes for gcc 4.5. from chuq. XXX i'm not sure all of
these work properly wtf pointer aliasing, but there are no casts at
least...
the lib/libpuffs/puffs_priv.h is definately a real bug fix.
from chuq.
diffstat:
common/lib/libc/gen/rb.c | 8 +++---
crypto/dist/heimdal/lib/krb5/convert_creds.c | 4 +-
crypto/dist/heimdal/lib/krb5/init_creds_pw.c | 4 +-
crypto/dist/heimdal/lib/krb5/rd_req.c | 4 +-
crypto/external/bsd/openssh/dist/progressmeter.c | 6 ++--
external/bsd/bind/dist/lib/isc/unix/time.c | 4 +-
external/bsd/openldap/dist/libraries/liblutil/detach.c | 4 +-
lib/libc/compat/sys/compat_getdents.c | 9 ++++--
lib/libc/db/btree/bt_split.c | 23 ++++++++++-------
lib/libc/db/recno/rec_put.c | 6 ++--
lib/libc/gdtoa/strtof.c | 7 ++++-
lib/libc/rpc/clnt_dg.c | 16 ++++++------
lib/libedit/eln.c | 6 ++--
lib/libpuffs/puffs_priv.h | 4 +-
sys/arch/amd64/include/stdarg.h | 7 ++++-
15 files changed, 65 insertions(+), 47 deletions(-)
diffs (truncated from 402 to 300 lines):
diff -r b9c96ffc581f -r 6e2b7634bc2b common/lib/libc/gen/rb.c
--- a/common/lib/libc/gen/rb.c Mon Jun 20 08:47:12 2011 +0000
+++ b/common/lib/libc/gen/rb.c Mon Jun 20 09:11:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rb.c,v 1.10 2011/04/12 16:19:44 matt Exp $ */
+/* $NetBSD: rb.c,v 1.11 2011/06/20 09:11:16 mrg Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -39,10 +39,10 @@
#else
#define KASSERT(s) do { } while (/*CONSTCOND*/ 0)
#endif
-__RCSID("$NetBSD: rb.c,v 1.10 2011/04/12 16:19:44 matt Exp $");
+__RCSID("$NetBSD: rb.c,v 1.11 2011/06/20 09:11:16 mrg Exp $");
#else
#include <lib/libkern/libkern.h>
-__KERNEL_RCSID(0, "$NetBSD: rb.c,v 1.10 2011/04/12 16:19:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rb.c,v 1.11 2011/06/20 09:11:16 mrg Exp $");
#endif
#ifdef _LIBC
@@ -91,7 +91,7 @@
{
rbt->rbt_ops = ops;
- *((const struct rb_node **)&rbt->rbt_root) = RB_SENTINEL_NODE;
+ rbt->rbt_root = RB_SENTINEL_NODE;
RB_TAILQ_INIT(&rbt->rbt_nodes);
#ifndef RBSMALL
rbt->rbt_minmax[RB_DIR_LEFT] = rbt->rbt_root; /* minimum node */
diff -r b9c96ffc581f -r 6e2b7634bc2b crypto/dist/heimdal/lib/krb5/convert_creds.c
--- a/crypto/dist/heimdal/lib/krb5/convert_creds.c Mon Jun 20 08:47:12 2011 +0000
+++ b/crypto/dist/heimdal/lib/krb5/convert_creds.c Mon Jun 20 09:11:16 2011 +0000
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
__RCSID("$Heimdal: convert_creds.c 22050 2007-11-11 11:20:46Z lha $"
- "$NetBSD: convert_creds.c,v 1.2 2008/03/22 08:37:13 mlelstv Exp $");
+ "$NetBSD: convert_creds.c,v 1.3 2011/06/20 09:11:16 mrg Exp $");
#include "krb5-v4compat.h"
@@ -172,7 +172,7 @@
keytype = v5_creds->session.keytype;
- if (keytype != ENCTYPE_DES_CBC_CRC) {
+ if (keytype != (krb5_keytype)ENCTYPE_DES_CBC_CRC) {
/* MIT krb524d doesn't like nothing but des-cbc-crc tickets,
so go get one */
krb5_creds template;
diff -r b9c96ffc581f -r 6e2b7634bc2b crypto/dist/heimdal/lib/krb5/init_creds_pw.c
--- a/crypto/dist/heimdal/lib/krb5/init_creds_pw.c Mon Jun 20 08:47:12 2011 +0000
+++ b/crypto/dist/heimdal/lib/krb5/init_creds_pw.c Mon Jun 20 09:11:16 2011 +0000
@@ -34,7 +34,7 @@
#include "krb5_locl.h"
__RCSID("$Heimdal: init_creds_pw.c 21931 2007-08-27 14:11:55Z lha $"
- "$NetBSD: init_creds_pw.c,v 1.2 2008/03/22 08:37:13 mlelstv Exp $");
+ "$NetBSD: init_creds_pw.c,v 1.3 2011/06/20 09:11:16 mrg Exp $");
typedef struct krb5_get_init_creds_ctx {
KDCOptions flags;
@@ -806,7 +806,7 @@
heim_octet_string *data)
{
krb5_error_code ret;
- if (paid->etype == ENCTYPE_NULL)
+ if (paid->etype == (krb5_enctype)ENCTYPE_NULL)
return NULL;
ret = set_paid(paid, context,
paid->etype,
diff -r b9c96ffc581f -r 6e2b7634bc2b crypto/dist/heimdal/lib/krb5/rd_req.c
--- a/crypto/dist/heimdal/lib/krb5/rd_req.c Mon Jun 20 08:47:12 2011 +0000
+++ b/crypto/dist/heimdal/lib/krb5/rd_req.c Mon Jun 20 09:11:16 2011 +0000
@@ -34,7 +34,7 @@
#include <krb5_locl.h>
__RCSID("$Heimdal: rd_req.c 22235 2007-12-08 21:52:07Z lha $"
- "$NetBSD: rd_req.c,v 1.2 2008/03/22 08:37:15 mlelstv Exp $");
+ "$NetBSD: rd_req.c,v 1.3 2011/06/20 09:11:16 mrg Exp $");
static krb5_error_code
decrypt_tkt_enc_part (krb5_context context,
@@ -482,7 +482,7 @@
if (ap_req_options) {
*ap_req_options = 0;
- if (ac->keytype != ETYPE_NULL)
+ if (ac->keytype != (krb5_keytype)ETYPE_NULL)
*ap_req_options |= AP_OPTS_USE_SUBKEY;
if (ap_req->ap_options.use_session_key)
*ap_req_options |= AP_OPTS_USE_SESSION_KEY;
diff -r b9c96ffc581f -r 6e2b7634bc2b crypto/external/bsd/openssh/dist/progressmeter.c
--- a/crypto/external/bsd/openssh/dist/progressmeter.c Mon Jun 20 08:47:12 2011 +0000
+++ b/crypto/external/bsd/openssh/dist/progressmeter.c Mon Jun 20 09:11:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: progressmeter.c,v 1.2 2009/06/07 22:38:47 christos Exp $ */
+/* $NetBSD: progressmeter.c,v 1.3 2011/06/20 09:11:16 mrg Exp $ */
/* $OpenBSD: progressmeter.c,v 1.37 2006/08/03 03:34:42 deraadt Exp $ */
/*
* Copyright (c) 2003 Nils Nordman. All rights reserved.
@@ -25,7 +25,7 @@
*/
#include "includes.h"
-__RCSID("$NetBSD: progressmeter.c,v 1.2 2009/06/07 22:38:47 christos Exp $");
+__RCSID("$NetBSD: progressmeter.c,v 1.3 2011/06/20 09:11:16 mrg Exp $");
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/uio.h>
@@ -182,7 +182,7 @@
percent = ((float)cur_pos / end_pos) * 100;
else
percent = 100;
- snprintf(buf + strlen(buf), win_size - strlen(buf-8),
+ snprintf(buf + strlen(buf), win_size - strlen(buf) - 8,
" %3d%% ", percent);
/* amount transferred */
diff -r b9c96ffc581f -r 6e2b7634bc2b external/bsd/bind/dist/lib/isc/unix/time.c
--- a/external/bsd/bind/dist/lib/isc/unix/time.c Mon Jun 20 08:47:12 2011 +0000
+++ b/external/bsd/bind/dist/lib/isc/unix/time.c Mon Jun 20 09:11:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: time.c,v 1.2 2011/02/16 03:47:15 christos Exp $ */
+/* $NetBSD: time.c,v 1.3 2011/06/20 09:11:16 mrg Exp $ */
/*
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
@@ -373,7 +373,7 @@
(time_t)0.5 != 0.5 && /* Not a floating point type. */
(i = (time_t)-1) != 4294967295u && /* Is signed. */
(seconds &
- (1U << (sizeof(time_t) * CHAR_BIT - 1))) != 0U) { /* Negative. */
+ (1ULL << (sizeof(time_t) * CHAR_BIT - 1))) != 0ULL) { /* Negative. */
/*
* This UNUSED() is here to shut up the IRIX compiler:
* variable "i" was set but never used
diff -r b9c96ffc581f -r 6e2b7634bc2b external/bsd/openldap/dist/libraries/liblutil/detach.c
--- a/external/bsd/openldap/dist/libraries/liblutil/detach.c Mon Jun 20 08:47:12 2011 +0000
+++ b/external/bsd/openldap/dist/libraries/liblutil/detach.c Mon Jun 20 09:11:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: detach.c,v 1.1.1.3 2010/12/12 15:22:08 adam Exp $ */
+/* $NetBSD: detach.c,v 1.2 2011/06/20 09:11:17 mrg Exp $ */
/* detach.c -- routines to daemonize a process */
/* OpenLDAP: pkg/ldap/libraries/liblutil/detach.c,v 1.18.2.5 2010/04/13 20:23:05 kurt Exp */
@@ -130,7 +130,7 @@
#ifdef HAVE_SETSID
(void) setsid();
-#elif TIOCNOTTY
+#elif defined(TIOCNOTTY)
if ( (sd = open( "/dev/tty", O_RDWR )) != -1 ) {
(void) ioctl( sd, TIOCNOTTY, NULL );
(void) close( sd );
diff -r b9c96ffc581f -r 6e2b7634bc2b lib/libc/compat/sys/compat_getdents.c
--- a/lib/libc/compat/sys/compat_getdents.c Mon Jun 20 08:47:12 2011 +0000
+++ b/lib/libc/compat/sys/compat_getdents.c Mon Jun 20 09:11:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_getdents.c,v 1.3 2008/04/28 20:22:59 martin Exp $ */
+/* $NetBSD: compat_getdents.c,v 1.4 2011/06/20 09:11:17 mrg Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: compat_getdents.c,v 1.3 2008/04/28 20:22:59 martin Exp $");
+__RCSID("$NetBSD: compat_getdents.c,v 1.4 2011/06/20 09:11:17 mrg Exp $");
#endif /* LIBC_SCCS and not lint */
#define __LIBC12_SOURCE__
@@ -50,6 +50,7 @@
{
struct dirent *ndp, *nndp, *endp;
struct dirent12 *odp;
+ ino_t ino;
int rv;
if ((rv = __getdents30(fd, buf, nbytes)) == -1)
@@ -67,7 +68,9 @@
for (; ndp < endp; ndp = nndp) {
nndp = _DIRENT_NEXT(ndp);
/* XXX: avoid unaligned 64-bit access on sparc64 */
- odp->d_ino = ((u_int32_t *)(void *)&ndp->d_ino)[_QUAD_LOWWORD];
+ /* XXX: does this work? */
+ memcpy(&ino, &ndp->d_ino, sizeof(ino_t));
+ odp->d_ino = (uint32_t)ino;
if (ndp->d_namlen >= sizeof(odp->d_name))
odp->d_namlen = sizeof(odp->d_name) - 1;
else
diff -r b9c96ffc581f -r 6e2b7634bc2b lib/libc/db/btree/bt_split.c
--- a/lib/libc/db/btree/bt_split.c Mon Jun 20 08:47:12 2011 +0000
+++ b/lib/libc/db/btree/bt_split.c Mon Jun 20 09:11:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bt_split.c,v 1.19 2009/04/22 18:44:06 christos Exp $ */
+/* $NetBSD: bt_split.c,v 1.20 2011/06/20 09:11:17 mrg Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: bt_split.c,v 1.19 2009/04/22 18:44:06 christos Exp $");
+__RCSID("$NetBSD: bt_split.c,v 1.20 2011/06/20 09:11:17 mrg Exp $");
#include "namespace.h"
#include <sys/types.h>
@@ -245,10 +245,12 @@
WR_BINTERNAL(dest, nksize ? nksize : bl->ksize,
rchild->pgno, bl->flags & P_BIGKEY);
memmove(dest, bl->bytes, nksize ? nksize : bl->ksize);
- if (bl->flags & P_BIGKEY &&
- bt_preserve(t, *(pgno_t *)(void *)bl->bytes) ==
- RET_ERROR)
- goto err1;
+ if (bl->flags & P_BIGKEY) {
+ pgno_t pgno;
+ memcpy(&pgno, bl->bytes, sizeof(pgno));
+ if (bt_preserve(t, pgno) == RET_ERROR)
+ goto err1;
+ }
break;
case P_RINTERNAL:
/*
@@ -564,9 +566,12 @@
* If the key is on an overflow page, mark the overflow chain
* so it isn't deleted when the leaf copy of the key is deleted.
*/
- if (bl->flags & P_BIGKEY &&
- bt_preserve(t, *(pgno_t *)(void *)bl->bytes) == RET_ERROR)
- return (RET_ERROR);
+ if (bl->flags & P_BIGKEY) {
+ pgno_t pgno;
+ memcpy(&pgno, bl->bytes, sizeof(pgno));
+ if (bt_preserve(t, pgno) == RET_ERROR)
+ return (RET_ERROR);
+ }
break;
case P_BINTERNAL:
bi = GETBINTERNAL(r, 0);
diff -r b9c96ffc581f -r 6e2b7634bc2b lib/libc/db/recno/rec_put.c
--- a/lib/libc/db/recno/rec_put.c Mon Jun 20 08:47:12 2011 +0000
+++ b/lib/libc/db/recno/rec_put.c Mon Jun 20 09:11:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rec_put.c,v 1.17 2008/09/11 12:58:00 joerg Exp $ */
+/* $NetBSD: rec_put.c,v 1.18 2011/06/20 09:11:17 mrg Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: rec_put.c,v 1.17 2008/09/11 12:58:00 joerg Exp $");
+__RCSID("$NetBSD: rec_put.c,v 1.18 2011/06/20 09:11:17 mrg Exp $");
#include "namespace.h"
#include <sys/types.h>
@@ -208,7 +208,7 @@
return (RET_ERROR);
tdata.data = db;
tdata.size = NOVFLSIZE;
- *(pgno_t *)(void *)db = pg;
+ memcpy(db, &pg, sizeof(*db));
_DBFIT(data->size, uint32_t);
*(uint32_t *)(void *)(db + sizeof(pgno_t)) =
(uint32_t)data->size;
diff -r b9c96ffc581f -r 6e2b7634bc2b lib/libc/gdtoa/strtof.c
--- a/lib/libc/gdtoa/strtof.c Mon Jun 20 08:47:12 2011 +0000
+++ b/lib/libc/gdtoa/strtof.c Mon Jun 20 09:11:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: strtof.c,v 1.4 2011/03/20 23:15:35 christos Exp $ */
+/* $NetBSD: strtof.c,v 1.5 2011/06/20 09:11:17 mrg Exp $ */
/****************************************************************
@@ -82,6 +82,11 @@
case STRTOG_NaN:
u.L[0] = f_QNAN;
+ break;
+
+ default:
+ u.L[0] = 0; /* for gcc warning */
+ break;
}
if (k & STRTOG_Neg)
u.L[0] |= 0x80000000L;
diff -r b9c96ffc581f -r 6e2b7634bc2b lib/libc/rpc/clnt_dg.c
--- a/lib/libc/rpc/clnt_dg.c Mon Jun 20 08:47:12 2011 +0000
+++ b/lib/libc/rpc/clnt_dg.c Mon Jun 20 09:11:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clnt_dg.c,v 1.24 2010/12/08 02:06:38 joerg Exp $ */
+/* $NetBSD: clnt_dg.c,v 1.25 2011/06/20 09:11:17 mrg Exp $ */
Home |
Main Index |
Thread Index |
Old Index