<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 06/12/2012 13:16, Jonas Maebe wrote:<br>
</div>
<blockquote
cite="mid:AEEE573D-4ADD-43A6-8F03-2D87AB1E250A@elis.ugent.be"
type="cite"><br>
<div>
<div>On 06 Dec 2012, at 14:03, Martin wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite"><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: Monaco; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-align: -webkit-auto;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width:
0px; font-size: medium; "><span class="Apple-style-span"
style="font-family: monospace; ">Yet what I do not
understand, is why I get that message as warning (as
opposed to a hint). If I understand it right (I have not
tested, maybe it gives a warning on 64 bit target too, if
so ignore the rest), and I compile for a 64bit target,
then it downgrades to a hint again?<br>
</span></span></blockquote>
<div><br>
</div>
<div>Yes. If you typecast an integer to a pointer and both have
the same size, you get a hint. If they have a different size,
you get a warning.</div>
<br>
<blockquote type="cite"><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: Monaco; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-align: -webkit-auto;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width:
0px; font-size: medium; "><span class="Apple-style-span"
style="font-family: monospace; ">The only difference is,
that in the above example, if compiled for a 32 bit
system, I already may have broken code. But then what it
actually means is that I should get warning about a
truncating the value.<br>
<br>
b := byte(a);<br>
Gives no warning at all.<br>
</span></span></blockquote>
<div><br>
</div>
<div>That's because truncating integers cannot result in invalid
addresses. The warning was added to help people moving from 32
bit to 64 bit systems and using longint typecasts in their
programs to convert between addresses and integers. There are
very few cases whereby discarding the upper 32 bit of a
pointer is intended or results in valid code.</div>
</div>
<br>
</blockquote>
<br>
Ok, thanks.<br>
<br>
It was only that I was working on 3cd party code, with many pointer
casts. And some did warn, some not (add to that that the IDE did
hide the hints. And I couldn't work out why I only got some
warnings, and not others.<br>
</body>
</html>