From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <41cc4313a739aeac187aeed775d9c9ca.axp-list@archive.invalid> X-Archive-Original-Message-ID: <199701181907.OAA07989@sable.cc.vt.edu> Date: Mon, 18 Jan 2010 14:07:17 -0500 From: Roger Subject: Re: Compiler Warnings 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 > 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