mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-09 22:26:07 +02:00
* also give a "potential range error" hint with -CO in case the sizes
match but the source range does not fit in the dest range (related to mantis #16023) * don't give a "potential range error" when converting between s80real and sc80real, since even though the size may differ, the represented range does not git-svn-id: trunk@15044 -
This commit is contained in:
parent
8542632ebe
commit
653974f679
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -9649,6 +9649,7 @@ tests/webtbf/tw15777b.pp svneol=native#text/plain
|
||||
tests/webtbf/tw1599.pp svneol=native#text/plain
|
||||
tests/webtbf/tw1599b.pp svneol=native#text/plain
|
||||
tests/webtbf/tw16022.pp svneol=native#text/plain
|
||||
tests/webtbf/tw16203.pp svneol=native#text/plain
|
||||
tests/webtbf/tw1633.pp svneol=native#text/plain
|
||||
tests/webtbf/tw1642.pp svneol=native#text/plain
|
||||
tests/webtbf/tw1655.pp svneol=native#text/plain
|
||||
|
@ -2708,7 +2708,15 @@ implementation
|
||||
not is_boolean(source.resultdef) and
|
||||
not is_constrealnode(source) then
|
||||
begin
|
||||
if (destdef.size < source.resultdef.size) then
|
||||
if ((destdef.size < source.resultdef.size) and
|
||||
{ s80real and sc80real have a different size but the same precision }
|
||||
not((destdef.typ=floatdef) and
|
||||
(source.resultdef.typ=floatdef) and
|
||||
(tfloatdef(source.resultdef).floattype in [s80real,sc80real]) and
|
||||
(tfloatdef(destdef).floattype in [s80real,sc80real]))) or
|
||||
((destdef.typ<>floatdef) and
|
||||
(source.resultdef.typ<>floatdef) and
|
||||
not is_in_limit(source.resultdef,destdef)) then
|
||||
begin
|
||||
if (cs_check_range in current_settings.localswitches) then
|
||||
MessagePos(location,type_w_smaller_possible_range_check)
|
||||
|
10
tests/webtbf/tw16203.pp
Normal file
10
tests/webtbf/tw16203.pp
Normal file
@ -0,0 +1,10 @@
|
||||
{ %OPT=-vh -Seh }
|
||||
{ %fail }
|
||||
|
||||
var
|
||||
B : Byte;
|
||||
s: shortint;
|
||||
begin
|
||||
b:=255;
|
||||
s:=b;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user