Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WuzpF-0006me-DI for pgsql-odbc@arkaria.postgresql.org; Thu, 12 Jun 2014 07:53:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WuzpD-0005RF-Hi for pgsql-odbc@arkaria.postgresql.org; Thu, 12 Jun 2014 07:53:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WuzpC-0005R8-L8 for pgsql-odbc@postgresql.org; Thu, 12 Jun 2014 07:53:30 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wuzp9-0001XH-3n for pgsql-odbc@postgresql.org; Thu, 12 Jun 2014 07:53:28 +0000 Received: from ayaki.localdomain (106-69-126-132.dyn.iinet.net.au [106.69.126.132]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0Lql1O-1WI4Uz3L1O-00eK30; Thu, 12 Jun 2014 09:53:24 +0200 Message-ID: <53995C6E.90509@2ndquadrant.com> Date: Thu, 12 Jun 2014 15:53:18 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: "pgsql-odbc@postgresql.org" Subject: Build failure with VS 2012 due to uninitialized pointers X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:lXuoXAwuNm+HoCnzJtGUxgQuBQmpXlV8fQYIuNGecIh Jo5MeDFgMmCweWkWeMYsW3mc0Xqvi4zAWIJOB6MYLNSgovzZuj wvdKn8KT2GkhW/AxU84MEQ2Ln7JJ0J+rlkAhY8XrUMeq8tUscd LP4pjJeUCJATGjqAzJsrUgxTUDeWl0vdrnWtq1MgPuATfI1EWh /S/WTXw90te0mxKiy8cAFJzYORmMzyNZiHx4zdwmCsLDgqBlVy HUeIZkXmToS3pJEB/Y/CsotJrVRFS6NHhVTu/5LByx4UMTp+CQ pKDKor80LhGOTQ/p9m+AXy4cZsaCSI9PA6ZijpThnKRqK9glK5 N/O4Yhd17rZFQKuqnTOEu/A764CWKVrooMvI4tsk6 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org Hi folks VS 2012 reports possibly uninitialized pointer access: c:\users\administrator\desktop\psqlodbc\connection.c(2073): error C4703: potentially uninitialized local pointer variable 'sock' used which is if (0 != (sockerr = SOCK_get_errcode(sock))) { in original_CC_connect(...). c:\users\administrator\desktop\psqlodbc\dlg_wingui.c(177): error C4703: potentially uninitialized local pointer variable 'comval' used which is CheckDlgButton(hdlg, DRV_COMMLOG, comval->commlog); By default it treats these as fatal errors, so the codebase won't build on VS 2012. BuildAll.ps1 doesn't seem to provide a simple way to pass extra CFLAGS into the build (to pass /sdl- per http://msdn.microsoft.com/en-us/library/jj161081.aspx), and it isn't really desirable to just turn the warning off anyway. I've taken a look at what's going on. In the case of the first one the function is not small and its flow isn't simple. I thought I'd mention the issue here first, in case somebody was able to immediately see what's missing. While I could just: - SocketClass *sock; + SocketClass *sock = NULL; I'm pretty sure that's just papering over whatever the real problem is. The second, the comval error, looks to be a missing default: clause in the case. If this were backend code I'd just toss in an elog(FATAL,"Unreachable code reached"); but that's not going to be much good in psqlODBC. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc