[fpc-pascal] Ansi strings

Carsten Bager carsten at beas.dk
Thu Aug 31 13:13:42 CEST 2006


Here is 2 examples of how the fpc compiler dos when comparing a 
string constant with a pchar . The first is compiled with the 204 
compiler and second one is compiled with the 202 compiler.
I am using the compiler on an embedded Arm 7 platform and Ansi 
strings is not an option. 
I want to force the 204 compiler to use short strings but the only 
option I can se, that have anything to do with strings is the (-Sh use 
ansistrings) and that is just the opposite of what I want.
Any hints?
 
Carsten



----------------------- 204 ---------------------------------
        .stabn 68,0,198,.Ll126 - Beas_Do_Text_Write
# [198] if FileName=BeasTyp.COM1name then
        ldr     r0,.L672
        ldr     r4,[r0]
        sub     r0,r11,#120
        bl      FPC_ANSISTR_DECR_REF
        ldr     r0,[r11, #-44]
        bl      fpc_pchar_to_ansistr
        str     r0,[r11, #-120]
        ldr     r0,[r11, #-120]
        mov     r1,r4
        bl      fpc_ansistr_compare
        cmp     r0,#0
        beq     .L665
        b       .L666
------------------ 202 -------------------------------------
        .stabn 68,0,198,.Ll124 - Beas_Do_Text_Write
# [198] if FileName=BeasTyp.COM1name then
        ldr     r4,.L615
        ldr     r1,[r11, #-44]
        sub     r0,r11,#312
        bl      fpc_pchar_to_shortstr
        sub     r0,r11,#312
        mov     r1,r4
        bl      fpc_shortstr_compare
        cmp     r0,#0
        beq     .L610
        b       .L611




More information about the fpc-pascal mailing list