From: arnoud <arnoud@firstlinux.net>
Subject: Re: warning: cast from pointer
Date: 2000/12/07 [thread overview]
Message-ID: <3A2F5F6A.832F8AB9@firstlinux.net> (raw)
In-Reply-To: 90l6v9$v8l$1@nnrp1.deja.com
For those cases that the warning is "just a warning" you should (MUST) do
the
cast your self e.g. if you have:
char cPrevCounter;
int iPnt;
cPrevCounter = (char)iPnt;
instead of
cPrevCounter = iPnt;
In this way you (or other reviewing your code) knows that you DID think
over that
there is the possiblity of cast problem.
If the warning isn't jus a warning you should fix the code for this!!!
Regards,
Arnoud.
"Dr. Unk" wrote:
> I would like know how to clean up a source, so that I do not get any
> more "warning: cast from pointer to integer of different size" or
> "incompatible pointer" warnings. I know that in most cases they are
> just that, warnings. But sometimes, I believe them to be the cause if
> many seg faults and floating point exceptions.
>
> My C knowledge is basic-level (2 courses taken). My system is an
> AlphaPC 164SX, Glibc-2.1.3, GCC-2.95.2, Linux-2.2.17.
>
> Thanks in advance.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
next prev parent reply other threads:[~2000-12-07 5:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-06 5:00 warning: cast from pointer Dr. Unk
2000-12-07 5:00 ` arnoud [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-12-06 5:00 Dr. Unk
2000-12-06 5:00 ` Dan Pop
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox