public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Could egcs warn at (int*)(int)(x)?
@ 1997-12-15 11:59 Tobias Polzin
  0 siblings, 0 replies; 3+ messages in thread
From: Tobias Polzin @ 1997-12-15 11:59 UTC (permalink / raw)
  To: egcs

Sorry, I forgot to mention that it was a C++ program.
Obviously gcc warns about such problems, but g++ does not.

  int* foo=(int*)((int)bar + delta);

Tobias Polzin

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Could egcs warn at (int*)(int)(x)?
@ 1997-12-15  9:34 Tobias Polzin
  1997-12-15 10:37 ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Polzin @ 1997-12-15  9:34 UTC (permalink / raw)
  To: egcs

I had problems with porting a software package to a 64 bit architecture.
After exhausting debugging-sessions I found that the problem were "pointer->
int->pointer"-casts which loose the upper 32 bit of the address. 
The usual warnings (-wAll -Wconversion -Wpointer-arith) do not detect
this porblems.

Is there any possibility to get warnings for things like:
   int* foo=(int*)((int)bar + delta);
Or even for
   int  delta= long(newaddress)-long(oldaddress).

Tobias "2b" Polzin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-12-15 11:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-15 11:59 Could egcs warn at (int*)(int)(x)? Tobias Polzin
  -- strict thread matches above, loose matches on Subject: below --
1997-12-15  9:34 Tobias Polzin
1997-12-15 10:37 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).