View Issue Details

IDProjectCategoryView StatusLast Update
0034027FPCCompilerpublic2021-02-06 13:43
ReporterMarģers Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSlinux 
Product Version3.1.1 
Fixed in Version3.3.1 
Summary0034027: compile time error: Incompatibel types: got "SYSTEM.PChar" expected "SYSTEM.PChar"
DescriptionCompiler does not accept pointer arithmetic for type PChar for
constant variables.
Steps To Reproducetype tz = record
       name : pchar;
     end;
const aa :array[0..2] of char = 'aa'#0;

const testArrZ : array [0..2] of tz = (
     (name: @aa), { Ok }
     (name: pchar(@aa)), { Ok }
     (name: pchar(@aa)+1) {Error: Incompatibel types: got "SYSTEM.PChar" expected "SYSTEM.PChar" }
     );

var b : pchar;
   
begin
     b:=pchar(@aa)+1; {Ok}
end.
TagsNo tags attached.
Fixed in Revision48514
FPCOldBugId
FPCTarget-
Attached Files

Activities

Bart Broersma

2021-02-05 17:21

reporter   ~0128787

3.3.1 (r48092) now says: Error: Illegal expression.
Does that count as a fix?
(The original errormessage was a (funny) bug in itself)

Florian

2021-02-06 13:43

administrator   ~0128795

I have fixed it properly, it works now.

Issue History

Date Modified Username Field Change
2018-07-24 21:47 Marģers New Issue
2021-02-05 17:21 Bart Broersma Note Added: 0128787
2021-02-06 13:43 Florian Assigned To => Florian
2021-02-06 13:43 Florian Status new => resolved
2021-02-06 13:43 Florian Resolution open => fixed
2021-02-06 13:43 Florian Fixed in Version => 3.3.1
2021-02-06 13:43 Florian Fixed in Revision => 48514
2021-02-06 13:43 Florian FPCTarget => -
2021-02-06 13:43 Florian Note Added: 0128795