Hi Folks! By Compiling the following program with the given unit, the compiler throws no warning but fails running. program Foo; uses MySQL; begin WriteLn (MySQLOptConnectTimeout); MySQLOptConnectTimeout := 100; WriteLn (MySQLOptConnectTimeout); end. { ======== } unit MySQL; interface var MySQLOptConnectTimeout: Integer; external name '_p_MYSQL_OPT_CONNECT_TIMEOUT'; attribute (const); implementation {$L mysqlc.c, mysqlclient} end. _p_MYSQL_OPT_CONNECT_TIMEOUT is defined as "const int" in a C file. What do I have to do to make GPC throwing at least one warning like "accessing read only variable". BTW: Is mixing of attributes allowed like this: MySQLOptConnectTimeout: Integer; external; attribute (const, name ('_p_MYSQL_OPT_CONNECT_TIMEOUT')); Eike
participants (3)
-
Eike Lange -
Frank Heckenbach -
Russell Whitaker