View Issue Details

IDProjectCategoryView StatusLast Update
0009918FPCCompilerpublic2008-03-29 21:46
ReporterYannick DuchêneAssigned ToJonas Maebe 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version2.2.0Product Build 
Target VersionFixed in Version2.2.2 
Summary0009918: Switching off extended syntax disallow assignment of dynamic arrays variables
DescriptionUnder FPC 2.2.0, the following code does not compile :

{EXTENDEDSYNTAX-}

PROCEDURE Test;
TYPE T = ARRAY OF Char;
VAR V : T;
BEGIN V := V;
END;

The compiler raise an "illegal expression" on "V := V;".

The code compiles normally as soon as one swith extended syntax on.

This is a bug, beceause extended syntax does not have anything to deal with dynamic arrays assignments. A personal comments : all my codes disable the extended syntax, beceause I consider it to be a nonsense (so I do not like the compiler default behaviour), and all my codes which did compile normally under FPC 2.0, now did not compile any more under FPC 2.2.0.

This may be due to the implementation of dynamic arrays assignment in FPC 2.2.0, which may internally represent it using function which may be called has procedure ? But I did not see how a such implementation could exist.

Well, here is what I could know about this bug.

Many thanks to the FPC team :)
TagsNo tags attached.
Fixed in Revision8822
FPCOldBugId0
FPCTarget-
Attached Files

Activities

Jonas Maebe

2007-10-12 11:29

manager   ~0015366

Variant assignment is now indeed handled using an internal function which returns the size of the copied data (because that function is also used internally in the rtl, where this information is required in some cases).

I'll have a look at it.

Yannick Duchêne

2007-10-12 12:40

reporter   ~0015371

Thanks to you Jonas :)

Reading you, a question is rising into my mind : do you mean that now the copy of a dynamique array does a copy of the content and no more the copy of an internal reference to the array data ? I do not think so, beaceause if will break a lot of code. Is that it ? Or do you mean a copy of the reference, while returning the array length in the same time ?

Jonas Maebe

2007-10-12 15:33

manager   ~0015375

The copy semantics have not changed. I don't know which size exactly that function returns, but it's not important user programs cannot access what it returns anyway.

Issue History

Date Modified Username Field Change
2007-10-11 23:38 Yannick Duchêne New Issue
2007-10-12 11:29 Jonas Maebe Status new => assigned
2007-10-12 11:29 Jonas Maebe Assigned To => Jonas Maebe
2007-10-12 11:29 Jonas Maebe Note Added: 0015366
2007-10-12 12:40 Yannick Duchêne Note Added: 0015371
2007-10-12 15:33 Jonas Maebe Note Added: 0015375
2007-10-14 12:56 Jonas Maebe Fixed in Revision => 8790
2007-10-14 12:56 Jonas Maebe Status assigned => resolved
2007-10-14 12:56 Jonas Maebe Fixed in Version => 2.3.1
2007-10-14 12:56 Jonas Maebe Resolution open => fixed
2007-10-16 17:08 Jonas Maebe FPCOldBugId => 0
2007-10-16 17:08 Jonas Maebe FPCTarget => -
2007-10-16 17:08 Jonas Maebe Fixed in Revision 8790 => 8822
2007-10-16 17:08 Jonas Maebe Fixed in Version 2.3.1 => 2.2.1
2008-03-29 21:46 Jonas Maebe Status resolved => closed