Re: example program bug?
От | Gavin Sherry |
---|---|
Тема | Re: example program bug? |
Дата | |
Msg-id | Pine.LNX.4.21.0108131833160.3410-100000@linuxworld.com.au обсуждение исходный текст |
Ответ на | example program bug? (Tatsuo Ishii <t-ishii@sra.co.jp>) |
Ответы |
Re: example program bug?
|
Список | pgsql-hackers |
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
В списке pgsql-hackers по дате отправления: