assignment type mismatch complaints

Started by Larry Rosenmanover 23 years ago5 messageshackers
Jump to latest
#1Larry Rosenman
ler@lerctr.org

How concerned are we about assignment type mismatch warnings?

I got a bunch in the mb stuff, and some in other places from the
UnixWare 7.1.3 compiler. We still pass all regression tests.

LER
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

#2Bruce Momjian
bruce@momjian.us
In reply to: Larry Rosenman (#1)
Re: assignment type mismatch complaints

Can you send over a list of the errors and we will check them out.

---------------------------------------------------------------------------

Larry Rosenman wrote:

How concerned are we about assignment type mismatch warnings?

I got a bunch in the mb stuff, and some in other places from the
UnixWare 7.1.3 compiler. We still pass all regression tests.

LER
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Larry Rosenman (#1)
Re: assignment type mismatch complaints

Larry Rosenman <ler@lerctr.org> writes:

How concerned are we about assignment type mismatch warnings?

They're probably all "char versus unsigned char" complaints?

There are a ton of them on compilers that care about it; most of
'em in the multibyte support. While it would be nice to clean up
all that someday, I can't say that I think it's a really profitable
use of time.

One difficulty is that the obvious fix (add a bunch of casts) is
probably a net degradation of the code. Explicit casts will hide
mismatches that are a lot worse than char signedness, and so
cluttering the code with them makes things more fragile IMHO.
I think an acceptable fix would involve running around and changing
datatype and function declarations; which is much more subtle and
thought-requiring than throwing in a cast wherever the compiler
burps.

regards, tom lane

#4Larry Rosenman
ler@lerctr.org
In reply to: Tom Lane (#3)
Re: assignment type mismatch complaints

On Sat, 2002-10-26 at 18:27, Tom Lane wrote:

Larry Rosenman <ler@lerctr.org> writes:

How concerned are we about assignment type mismatch warnings?

They're probably all "char versus unsigned char" complaints?

Probably. The first few I looked at are PG_GETARG_CSTRING to unsigned
char assignments. (I can send the whole list to either you, Tom, or the
list).

There are a ton of them on compilers that care about it; most of
'em in the multibyte support. While it would be nice to clean up
all that someday, I can't say that I think it's a really profitable
use of time.

Ok, I understand that. It seems that there are a bunch, but they are
just warnings.

One difficulty is that the obvious fix (add a bunch of casts) is
probably a net degradation of the code. Explicit casts will hide
mismatches that are a lot worse than char signedness, and so
cluttering the code with them makes things more fragile IMHO.
I think an acceptable fix would involve running around and changing
datatype and function declarations; which is much more subtle and
thought-requiring than throwing in a cast wherever the compiler
burps.

Understand, and I don't expect it to happen in a beta test :-).

regards, tom lane

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

#5Larry Rosenman
ler@lerctr.org
In reply to: Larry Rosenman (#4)
Re: assignment type mismatch complaints

On Sat, 2002-10-26 at 18:34, Larry Rosenman wrote:

On Sat, 2002-10-26 at 18:27, Tom Lane wrote:

Larry Rosenman <ler@lerctr.org> writes:

How concerned are we about assignment type mismatch warnings?

They're probably all "char versus unsigned char" complaints?

Probably. The first few I looked at are PG_GETARG_CSTRING to unsigned
char assignments. (I can send the whole list to either you, Tom, or the
list).

There are a ton of them on compilers that care about it; most of
'em in the multibyte support. While it would be nice to clean up
all that someday, I can't say that I think it's a really profitable
use of time.

Ok, I understand that. It seems that there are a bunch, but they are
just warnings.

One difficulty is that the obvious fix (add a bunch of casts) is
probably a net degradation of the code. Explicit casts will hide
mismatches that are a lot worse than char signedness, and so
cluttering the code with them makes things more fragile IMHO.
I think an acceptable fix would involve running around and changing
datatype and function declarations; which is much more subtle and
thought-requiring than throwing in a cast wherever the compiler
burps.

Understand, and I don't expect it to happen in a beta test :-).

If anyone wants to look at these:

ftp://ftp.lerctr.org/pub/pg-dev/gmake.out.txt

Thanks,
LER

regards, tom lane

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749