PB 4.51f x86 Size of character in resident is fixed
Posted: Thu Oct 07, 2010 9:37 pm
Using PB V4.51 final on XP 32bit
There seem to be a bug in the creation of resident files with the size of characters (.c) in structures.
If you use such structures, the size of .c stays as the compiler setting of ascii / unicode generated code when the resident file was created.
If you make this into a resident file, restart the compiler and than use this:
It always show 1 if the resident was compiled with unicode 'off', and 2 if unicode was 'on', independent of the unicode setting for the above test.
In the structure viewer it will show as:
Structure MyChar
c.c
EndStructure
just like the predefined 'Character' structure of PB, but this will show the correct size of the structure.
It's also a problem when you use structures like this:
The characters are always accessed in address steps of 1 or 2, depending on the unicode setting of the compiled resident, not the actual source code setting.
Only workaround I see at the moment, is to not make files containing such structures into residents, but to include them via XIncludeFile on each compilation.
Might be that .i is also not correctly sized, but I only have 32 bit windows, so I can't check this.
There seem to be a bug in the creation of resident files with the size of characters (.c) in structures.
If you use such structures, the size of .c stays as the compiler setting of ascii / unicode generated code when the resident file was created.
Code: Select all
Structure MyChar
c.c
EndStructure
Code: Select all
Debug SizeOf(MyChar)
In the structure viewer it will show as:
Structure MyChar
c.c
EndStructure
just like the predefined 'Character' structure of PB, but this will show the correct size of the structure.
It's also a problem when you use structures like this:
Code: Select all
Structure MyCharVector
c.c[0]
EndStructure
Only workaround I see at the moment, is to not make files containing such structures into residents, but to include them via XIncludeFile on each compilation.
Might be that .i is also not correctly sized, but I only have 32 bit windows, so I can't check this.