missing time.h include in psql/command.c since the addition of \watch
Hi,
our internal testbuilds show a new warning on windows:
src\bin\psql\command.c(2617): warning C4013: 'time' undefined; assuming extern returning int [C:\jenkins\workspace\andres_git.postgresql.org_windows\BT\release\SL_OS\windows\TA\x86\TO\xp\psql.vcxproj]
src\bin\psql\command.c(2619): warning C4013: 'asctime' undefined; assuming extern returning int [C:\jenkins\workspace\andres_git.postgresql.org_windows\BT\release\SL_OS\windows\TA\x86\TO\xp\psql.vcxproj]
src\bin\psql\command.c(2619): warning C4013: 'localtime' undefined; assuming extern returning int [C:\jenkins\workspace\andres_git.postgresql.org_windows\BT\release\SL_OS\windows\TA\x86\TO\xp\psql.vcxproj]
Looking at command.c its neither surprising that we get that warning,
nor that we don't get it on non-windows builds. Those get time.h via
portability/instr_time.h.
So it seems we should add a time.h include to command.c. Trivial patch
for that attached.
Not sure why that warning isn't visible on the buildfarm though...
Greetings,
Andres Freund
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
Attachments:
add-time-h-to-psql-command-c.patchtext/x-patch; charset=us-asciiDownload
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 09939fd..2e74284 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -13,6 +13,8 @@
#endif
#include <ctype.h>
+#include <time.h>
+
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
On 24.04.2013 16:27, Andres Freund wrote:
Hi,
our internal testbuilds show a new warning on windows:
src\bin\psql\command.c(2617): warning C4013: 'time' undefined; assuming extern returning int [C:\jenkins\workspace\andres_git.postgresql.org_windows\BT\release\SL_OS\windows\TA\x86\TO\xp\psql.vcxproj]
src\bin\psql\command.c(2619): warning C4013: 'asctime' undefined; assuming extern returning int [C:\jenkins\workspace\andres_git.postgresql.org_windows\BT\release\SL_OS\windows\TA\x86\TO\xp\psql.vcxproj]
src\bin\psql\command.c(2619): warning C4013: 'localtime' undefined; assuming extern returning int [C:\jenkins\workspace\andres_git.postgresql.org_windows\BT\release\SL_OS\windows\TA\x86\TO\xp\psql.vcxproj]Looking at command.c its neither surprising that we get that warning,
nor that we don't get it on non-windows builds. Those get time.h via
portability/instr_time.h.So it seems we should add a time.h include to command.c. Trivial patch
for that attached.
Thanks, applied.
- Heikki
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers