From owner-freebsd-current Tue May 9 17:45:32 2000 Delivered-To: freebsd-current@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.100.7]) by hub.freebsd.org (Postfix) with ESMTP id CC70237B548 for ; Tue, 9 May 2000 17:45:29 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.9.3/8.9.3) with ESMTP id UAA68450; Tue, 9 May 2000 20:45:17 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Tue, 9 May 2000 20:45:21 -0400 To: shimon@simon-shapiro.org, freebsd-current@FreeBSD.ORG From: Garance A Drosihn Subject: Re: One more question (different now) Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 7:08 PM -0400 5/9/00, Simon Shapiro wrote: >Given: > >typedef struct junk { > ... >} junk_t > >volatile junk_t trash; > >What I want to do is zero out trash. > >bzero(trash, sizeof(junk_t)); > >produces a warning about loss of volatility. >So, how do I make everyone happy? Write a 'bzerov' function, which takes a volatile first parameter. Presumably you could just copy the source for bzero and change the 1st parameter declaration... or write a dumb 'bzerov' macro, which casts the first parameter to be pointer to volatile char, and then loops over it setting to zero one byte at a time. --- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or drosih@rpi.edu Rensselaer Polytechnic Institute To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message