Skip site navigation (1) Skip section navigation (2)

Re: Proposed patch to clean up signed-ness warnings

From: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: t-ishii(at)sra(dot)co(dot)jp, pgsql-patches(at)postgreSQL(dot)org,pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Proposed patch to clean up signed-ness warnings
Date: 2005-09-22 23:13:10
Message-ID: 20050923.081310.59651303.ishii@sraoss.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
> With gcc 4 spreading, it seems like it's past time to do something about
> all those signed-vs-unsigned-char warnings that it emits.  (Translation:
> now that I have to use gcc 4 regularly, I got annoyed enough to fix it
> ;-))
> 
> I looked into it a little and determined that nearly all the warnings
> were associated with the multibyte code.  Outside the mb subsystem,
> our code pretty much uses "char *" for strings, but inside mb it's
> mostly "unsigned char *", which is needed because there are lots of
> inequality comparisons in there.  It seemed to me that the cleanest
> fix was to change the external API of the mb subsystem to take and
> return "char *", while still using "unsigned char *" internally.
> The attached patch eliminates all signed-ness warnings in CVS tip
> using this approach.  It's kinda long and tedious, but straightforward,
> and quite a lot of the changes simplify existing code by removing
> casts that aren't needed anymore.
> 
> Two questions for the list:
> 
> 1. Can anyone think of a cleaner way to do this?
> 
> 2. Is there objection to applying this patch now (ie, before beta3)?
> It's not quite a bug fix, but I think it'll make it easier to find
> bugs going forward.

For me, your patche seems to be a retrogression. In my understanding,
the reason why PostgreSQL uses "char *" in many places is just it was
designed in the old days when ASCII was the only charset in the world.
--
SRA OSS, Inc. Japan
Tatsuo Ishii

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2005-09-22 23:18:28
Subject: Re: 2 forks for md5?
Previous:From: Tom LaneDate: 2005-09-22 22:42:52
Subject: Re: 2 forks for md5?

pgsql-patches by date

Next:From: Tom LaneDate: 2005-09-22 23:46:04
Subject: Re: Proposed patch to clean up signed-ness warnings
Previous:From: Tom LaneDate: 2005-09-22 22:29:11
Subject: Proposed patch to clean up signed-ness warnings

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group