Subject: Re: CVS commit: src/sys/arch/powerpc/conf
To: None <he@netbsd.org>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: source-changes
Date: 06/02/2005 15:10:48
This is a multipart MIME message.
--==_Exmh_1736610138180
Content-Type: text/plain; charset=us-ascii
> cannot be compiled with -Wno-cast-qual due to a volatile pointer
> being passed to memset(), and there's no easy way other than open-
> coding memset() to fix this
How about __UNVOLATILE?
best regards
Matthias
--==_Exmh_1736610138180
Content-Type: text/plain ; name="px.txt"; charset=us-ascii
Content-Description: px.txt
Content-Disposition: attachment; filename="px.txt"
Index: tc/px.c
===================================================================
RCS file: /cvsroot/src/sys/dev/tc/px.c,v
retrieving revision 1.23
diff -u -r1.23 px.c
--- tc/px.c 27 Feb 2005 00:27:49 -0000 1.23
+++ tc/px.c 2 Jun 2005 13:08:57 -0000
@@ -378,7 +378,8 @@
}
sxc = si->si_sxc;
- memset((void *)sxc->sxc_done, 0, sizeof(sxc->sxc_done));
+#define UNVOLATILE(a) ((void *)(unsigned long)(volatile void *)(a))
+ memset(UNVOLATILE(sxc->sxc_done), 0, sizeof(sxc->sxc_done));
sxc->sxc_head = 0;
sxc->sxc_tail = 0;
sxc->sxc_nreject = 0;
--==_Exmh_1736610138180--