Subject: Re: can anyone help me fix warning: cast discards qualifiers from pointer target type
To: None <firstname.lastname@example.org>
From: Ian Zagorskih <email@example.com>
Date: 06/02/2005 12:42:37
On Thursday 02 June 2005 12:34, Hisashi T Fujinaka wrote:
> In src/sys/arch/i386/isa/pccons.c lines 1251 and 1252 give the error:
> /usr/src/sys/arch/i386/isa/pccons.c:1251: warning: cast discards qualifiers
> from pointer target type /usr/src/sys/arch/i386/isa/pccons.c:1252: warning:
> cast discards qualifiers from pointer target type
> I'm not sure how to fix this error. Can anyone help me out here? I do
> have some c programming under my belt but I've never seen this error. I
> also can't seem to find any information using google, since I just get
> people reporting this warning and few fixes.
AFAIU you'r casting volatile to normal type i.e.
u_short volatile *cp;
crtat = (u_short *)cp;
Is it required to declare *cp as volatile? In the pcinit() code I don't see
where it can be modified externally.