Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wvo8t-0007Pq-Eo for pgsql-odbc@arkaria.postgresql.org; Sat, 14 Jun 2014 13:37:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wvo8r-0000Cn-RD for pgsql-odbc@arkaria.postgresql.org; Sat, 14 Jun 2014 13:37:09 +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 1Wvo8p-0000Ce-QF for pgsql-odbc@postgresql.org; Sat, 14 Jun 2014 13:37:07 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by makus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wvo8g-0007HF-9y for pgsql-odbc@postgresql.org; Sat, 14 Jun 2014 13:37:05 +0000 Received: (qmail 11022 invoked by uid 512); 14 Jun 2014 13:36:54 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 14 Jun 2014 13:36:54 -0000 Received: from unknown (HELO ?192.168.1.8?) (183.76.63.174) by sd.tpf.co.jp with SMTP; 14 Jun 2014 13:36:54 -0000 Message-ID: <539C4FF6.2080906@tpf.co.jp> Date: Sat, 14 Jun 2014 22:36:54 +0900 From: "Inoue, Hiroshi" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Craig Ringer , "pgsql-odbc@postgresql.org" Subject: Re: Build failure with VS 2012 due to uninitialized pointers References: <53995C6E.90509@2ndquadrant.com> In-Reply-To: <53995C6E.90509@2ndquadrant.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 Thanks. Confirmed and committed. regards, Hiroshi Inoue (2014/06/12 16:53), Craig Ringer wrote: > 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. -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc