string literal as const var parameter

Prof A Olowofoyeku (The African Chief) chief at greatchief.plus.com
Wed Jun 27 08:40:36 CEST 2012


On 25 Jun 2012 at 22:18, Jay Michael wrote:

> gpc 20070904, based on gcc-3.4.5 (mingw special)
> 
>      I got a compilation error, "type mismatch", when I passed a string
> literal to a routine with a formal parameter of "const var s : string".
> In tests, this had been acceptable to the compiler.  I find that whether
> it is acceptable seems to be a function of whether the call is preceded
> by another call (to a different routine), passing a string literal to
> (as?) a "const s : string" formal parameter.
> 
> jsm1bad.pas gets a "type mismatch" compilation error.
> jsm1ok.pas  compiles, links, and executes.

Maybe it is just me - but I don't know what a "const var" is. I do know 
about these:

s : string
var s : string
const s : string

To me, "const var s : string" is a syntax error. This seems like a 
relic from certain other programming languages ...

Best regards, The Chief
--------
Prof. Abimbola A. Olowofoyeku (The African Chief) 
web:  http://www.greatchief.plus.com/




More information about the Gpc mailing list