pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-odbc@postgresql.org>
Subject: Re: Elimination of (more or less) all compilation warnings on OSX
Date: Thu, 06 Mar 2014 11:50:51 -0500
Message-ID: <27047.1394124651@sss.pgh.pa.us> (raw)
In-Reply-To: <53189C96.1050609@vmware.com>
References: <CAB7nPqSSt31_LDfQDTYXCysFMdB1NgLtjR6XUF5CL6f_O4OGaQ@mail.gmail.com>
	<53187E62.4080907@vmware.com>
	<53189C96.1050609@vmware.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> It's worth noting that isspace, isdigit etc. take an "unsigned char" 
> argument. The compiler won't warn if you pass a "char", so you have to 
> be careful with that. In practice, I don't think it will lead to actual 
> bugs on any real platform and locale, but still..

It definitely used to lead to bugs on some old platforms.  It may be
that everybody is more careful nowadays, but the POSIX spec is still
perfectly clear about it:

	  The c argument is an int, the value of which the application
	  shall ensure is a character representable as an unsigned char or
	  equal to the value of the macro EOF. If the argument has any
	  other value, the behavior is undefined.

I had my old HPUX box hacked up so that gcc would produce "subscript
is a char" warnings for unsafe usage.  It seems a bit more difficult to
get modern platforms to do that, though; people stopped exposing the
underlying flag array in the system headers ...

			regards, tom lane


-- 
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 (5+ messages)  latest in thread

Message-ID: <27047.1394124651@sss.pgh.pa.us>
Permalink:  ../27047.1394124651@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27047.1394124651@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, hlinnakangas@vmware.com, michael.paquier@gmail.com
  Subject: Re: Elimination of (more or less) all compilation warnings on OSX
  In-Reply-To: <27047.1394124651@sss.pgh.pa.us>
  References: <CAB7nPqSSt31_LDfQDTYXCysFMdB1NgLtjR6XUF5CL6f_O4OGaQ@mail.gmail.com> <53187E62.4080907@vmware.com> <53189C96.1050609@vmware.com> <27047.1394124651@sss.pgh.pa.us>

* 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