mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-03 23:38:34 +02:00
* write a proper error message if types are read/written which are not supported in iso mode, resolves #37763
git-svn-id: trunk@46885 -
This commit is contained in:
parent
e2647ea072
commit
60bd9c5ba0
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16577,6 +16577,7 @@ tests/webtbf/tw37460.pp svneol=native#text/pascal
|
||||
tests/webtbf/tw37462.pp svneol=native#text/pascal
|
||||
tests/webtbf/tw37475.pp svneol=native#text/pascal
|
||||
tests/webtbf/tw37476.pp svneol=native#text/pascal
|
||||
tests/webtbf/tw37763.pp svneol=native#text/pascal
|
||||
tests/webtbf/tw3790.pp svneol=native#text/plain
|
||||
tests/webtbf/tw3812.pp svneol=native#text/plain
|
||||
tests/webtbf/tw3930a.pp svneol=native#text/plain
|
||||
|
@ -2064,6 +2064,9 @@ type_e_forward_interface_type_does_not_match=04127_E_The interface type of the f
|
||||
type_e_generic_const_type_not_allowed=04128_E_Type not allowed for generic constant parameter: $1
|
||||
% Only types that can also be used (indirectly) for untyped constants can be used as a
|
||||
% type for a generic constant parameter.
|
||||
type_e_cant_read_write_type_in_iso_mode=04129_E_Can't read or write variables of this type in iso mode
|
||||
% You are trying to \var{read} or \var{write} a variable from or to a
|
||||
% file of type text, which doesn't support that variable's type in the selected language mode (iso mode).
|
||||
% \end{description}
|
||||
#
|
||||
# Symtable
|
||||
|
@ -585,6 +585,7 @@ const
|
||||
type_e_cblock_callconv=04126;
|
||||
type_e_forward_interface_type_does_not_match=04127;
|
||||
type_e_generic_const_type_not_allowed=04128;
|
||||
type_e_cant_read_write_type_in_iso_mode=04129;
|
||||
sym_e_id_not_found=05000;
|
||||
sym_f_internal_error_in_symtablestack=05001;
|
||||
sym_e_duplicate_id=05002;
|
||||
@ -1126,9 +1127,9 @@ const
|
||||
option_info=11024;
|
||||
option_help_pages=11025;
|
||||
|
||||
MsgTxtSize = 85732;
|
||||
MsgTxtSize = 85795;
|
||||
|
||||
MsgIdxMax : array[1..20] of longint=(
|
||||
28,106,356,129,99,63,143,36,223,68,
|
||||
28,106,356,130,99,63,143,36,223,68,
|
||||
62,20,30,1,1,1,1,1,1,1
|
||||
);
|
||||
|
1023
compiler/msgtxt.inc
1023
compiler/msgtxt.inc
File diff suppressed because it is too large
Load Diff
@ -765,7 +765,14 @@ implementation
|
||||
else
|
||||
case para.left.resultdef.typ of
|
||||
stringdef :
|
||||
name:=procprefixes[do_read]+tstringdef(para.left.resultdef).stringtypname;
|
||||
begin
|
||||
name:=procprefixes[do_read]+tstringdef(para.left.resultdef).stringtypname;
|
||||
if (m_isolike_io in current_settings.modeswitches) and (tstringdef(para.left.resultdef).stringtype<>st_shortstring) then
|
||||
begin
|
||||
CGMessagePos(para.fileinfo,type_e_cant_read_write_type_in_iso_mode);
|
||||
error_para := true;
|
||||
end;
|
||||
end;
|
||||
pointerdef :
|
||||
begin
|
||||
if (not is_pchar(para.left.resultdef)) or do_read then
|
||||
|
7
tests/webtbf/tw37763.pp
Normal file
7
tests/webtbf/tw37763.pp
Normal file
@ -0,0 +1,7 @@
|
||||
{ %fail }
|
||||
{$MODE ISO}
|
||||
program forum(output);
|
||||
var f:rawbytestring;
|
||||
begin
|
||||
writeln(f)
|
||||
end.
|
Loading…
Reference in New Issue
Block a user