On Mon, 13 Aug 2001, Tatsuo Ishii wrote:
> Included is a example program appears in our docs (libpq.sgml).
> As you can see, the very last part of the program:
>
> PQfinish(conn);
>
> return 0;
>
> never execute. Should we remove them?
Most compilers should be able to detect this and not generate
warnings. Compilers will default the return type of main() to int so
perhaps for the sake of form it should be left in there with a comment:
/* we never get here */
By the same line of thinking, PQfinish(conn) may as well stay.
There are other parts of the code which need fixing though. The call to
sleep() will generate a prototyping error on many systems, since it is
defined in unistd.h which is not included from the program in the 7.2
version of the docs (on the Web site). Similar problem with getenv(),
which is defined in stdlib.h.
Gavin