pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Inoue, Hiroshi <inoue@tpf.co.jp>
To: Craig Ringer <craig@2ndquadrant.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: Build failure with VS 2012 due to uninitialized pointers
Date: Sat, 14 Jun 2014 22:36:54 +0900
Message-ID: <539C4FF6.2080906@tpf.co.jp> (raw)
In-Reply-To: <53995C6E.90509@2ndquadrant.com>
References: <53995C6E.90509@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

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



view thread (3+ messages)  latest in thread

Message-ID: <539C4FF6.2080906@tpf.co.jp>
Permalink:  ../539C4FF6.2080906@tpf.co.jp/
Also on:    postgresql.org/message-id/539C4FF6.2080906@tpf.co.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: inoue@tpf.co.jp, craig@2ndquadrant.com
  Subject: Re: Build failure with VS 2012 due to uninitialized pointers
  In-Reply-To: <539C4FF6.2080906@tpf.co.jp>
  References: <53995C6E.90509@2ndquadrant.com> <539C4FF6.2080906@tpf.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox