From: Roger <rychen@vt.edu>
Subject: Re: Compiler Warnings
Date: Mon, 18 Jan 2010 14:07:17 -0500 [thread overview]
Message-ID: <41cc4313a739aeac187aeed775d9c9ca.axp-list@archive.invalid> (raw)
Yes I 100% agree with the point that conversion from pointer to interger
will lose half value of pointer and we should not write any code that way.
BUT this is a general rule that applies to normal circumstance. I believe a
rule can be bent under special/different circumstances. This case is one
of these special/different circumsatance. I believe C compiler gives
warnings to every possible mistakes just to be on the safe side. If you
check the codes that got these warnings you will see that you really don't
need to worry about them. one of the code that got warning message is:
int offset = (int)cmd->info;
And I don't see any problem with that line unless there is something I
don't know.
also another warning is about an integer been passed into a function then
the function passed this integer as pointer into another function. there
should not be any problem later if the pointer is converted to interger.
Other warnings are simliar to the cases I just showed above.
And btw I am not someone that "just ignore the warnings on integer <->
pointer conversions" principle.
-Roger
----------
> From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
> To: axp-list@redhat.com
> Subject: Re: Compiler Warnings
> Date: Saturday, January 18, 1997 12:27 PM
>
>
> >
> > > I am trying to compile apache-1.2b4, and everything compiles
> > > properly except for warnings of the type:
> > >
> > > "conversion from pointer to integer of different type."
> > >
> Roger responds:
>
> > Just ignore the warnings.
>
> Sigh! The best advice to produce broken executables.
>
> You may get lucky sometimes - as the original author did not really
> meant "pointer" when s/he wrote that; and conversions **from** integer
> **to** pointer can be often ignored. But converting from a pointer
> to integer on axp you are loosing half of yours - possibly significant -
> bits. This makes wonders to your references and a stack.
>
> > I compiled
> > apache-1.2b4 with these warnings, but the server is running fine
without
> > any problems so far.
>
> Wait and see. A grail error, which I posted just yesterday, is
> most likely caused by somebody following "just ignore the warnings
> on integer <-> pointer conversions" principle.
>
> Michal
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next reply other threads:[~2010-01-18 19:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-18 19:07 Roger [this message]
[not found] <199701180109.JAA03936@tapa.admu.edu.ph>
1997-01-18 16:22 ` Compiler Warnings Richard Henderson
1997-01-20 11:41 ` Jim Nance
[not found] <199701181907.OAA07989@sable.cc.vt.edu>
1997-01-18 20:47 ` Michal Jaegermann
1997-01-18 21:31 ` Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
1997-01-18 3:04 Roger
1997-01-18 17:27 ` Michal Jaegermann
1997-01-18 1:09 Pablo Manalastas
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