From owner-freebsd-current Tue May 9 16:27:17 2000 Delivered-To: freebsd-current@freebsd.org Received: from mass.cdrom.com (adsl-63-202-176-114.dsl.snfc21.pacbell.net [63.202.176.114]) by hub.freebsd.org (Postfix) with ESMTP id 7308E37B505 for ; Tue, 9 May 2000 16:27:13 -0700 (PDT) (envelope-from msmith@mass.cdrom.com) Received: from mass.cdrom.com (localhost [127.0.0.1]) by mass.cdrom.com (8.9.3/8.9.3) with ESMTP id QAA20838; Tue, 9 May 2000 16:27:10 -0700 (PDT) (envelope-from msmith@mass.cdrom.com) Message-Id: <200005092327.QAA20838@mass.cdrom.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: shimon@simon-shapiro.org Cc: freebsd-current@freebsd.org Subject: Re: One more question (different now) In-reply-to: Your message of "Tue, 09 May 2000 19:08:21 EDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 09 May 2000 16:27:10 -0700 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG The only answer I've seen for this one is to kick, hard, whoever it was that added -Wcast-qual to the kernel options. Or write your own, suboptimal, bzero code. > Hi Again, > > Since you were so kind to me, I will impose another > one on you (the previous answers were _all_ correct! ) > > 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 does: > > bzero((void *)&trash, sizeof(junk_t)); > > So, how do I make everyone happy? > > Oh, the struct has to be volatile. Trust me on that one. > > > > Sincerely Yours > 404.664.6401 > Simon Shapiro Research Fellow, Earthlink Inc. > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > > Hi Again, > > Since you were so kind to me, I will impose another > one on you (the previous answers were _all_ correct! ) > > 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 does: > > bzero((void *)&trash, sizeof(junk_t)); > > So, how do I make everyone happy? > > Oh, the struct has to be volatile. Trust me on that one. > > > > Sincerely Yours > 404.664.6401 > Simon Shapiro Research Fellow, Earthlink Inc. > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > -- \\ Give a man a fish, and you feed him for a day. \\ Mike Smith \\ Tell him he should learn how to fish himself, \\ msmith@freebsd.org \\ and he'll hate you for a lifetime. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message