string literal as const var parameter

Adriaan van Os gpc at
Wed Jun 27 11:47:30 CEST 2012

Jay Michael wrote:
> gpc 20070904, based on gcc-3.4.5 (mingw special)
>   { passing string literal to const var string formal parameter   }
>   { produces                                                      }
>   {   error: type mismatch in argument 1 of `rejecter'            }
>   { unless have previous call (to another routine) passing string }
>   { literal to const string                                       }

const var parameters were introduced to interface with external (C) routines where (1) the API 
requires that the parameter is passed by reference and (2) passing a constant as actual parameter 
should be allowed. For normal use, const parameters can be used.


Adriaan van Os

More information about the Gpc mailing list