Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 May 2000 16:27:10 -0700
From:      Mike Smith <msmith@freebsd.org>
To:        shimon@simon-shapiro.org
Cc:        freebsd-current@freebsd.org
Subject:   Re: One more question (different now) 
Message-ID:  <200005092327.QAA20838@mass.cdrom.com>
In-Reply-To: Your message of "Tue, 09 May 2000 19:08:21 EDT." <XFMail.000509190821.shimon@simon-shapiro.org> 

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200005092327.QAA20838>