pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ConnInfo assumes signed char
3+ messages / 3 participants
[nested] [flat]

* ConnInfo assumes signed char
@ 2003-02-07 18:13 Oliver Elphick <olly@lfix.co.uk>
  2003-02-08 17:16 ` Re: ConnInfo assumes signed char Tom Lane <tgl@sss.pgh.pa.us>
  2003-02-10 06:59 ` Re: ConnInfo assumes signed char Hiroshi Inoue <Inoue@tpf.co.jp>
  0 siblings, 2 replies; 3+ messages in thread

From: Oliver Elphick @ 2003-02-07 18:13 UTC (permalink / raw)
  To: pgsql-odbc

ConnInfo, defined in connection.h, assumes that char = signed char.

This is not true of Linux on arm, powerpc and s390, and possibly other
platforms.  As a result:

gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c dlg_specific.c -MT dlg_specific.lo -MD -MP -MF .deps/dlg_specific.TPlo  -fPIC -DPIC -o dlg_specific.lo
dlg_specific.c: In function `getDSNdefaults':
dlg_specific.c:398: warning: comparison is always false due to limited range of data type
dlg_specific.c:400: warning: comparison is always false due to limited range of data type
dlg_specific.c:402: warning: comparison is always false due to limited range of data type
dlg_specific.c:404: warning: comparison is always false due to limited range of data type
dlg_specific.c:406: warning: comparison is always false due to limited range of data type
dlg_specific.c: In function `getDSNinfo':
dlg_specific.c:484: warning: comparison is always false due to limited range of data type
dlg_specific.c:491: warning: comparison is always false due to limited range of data type
dlg_specific.c:498: warning: comparison is always false due to limited range of data type
dlg_specific.c:505: warning: comparison is always false due to limited range of data type
dlg_specific.c:512: warning: comparison is always false due to limited range of data type

The problem still exists in current CVS.

Where char may contain a negative value, it should explicitly be
declared as signed char.

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "But the LORD is in his holy temple; let all the earth 
      keep silence before him."           Habakkuk 2:20 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: ConnInfo assumes signed char
  2003-02-07 18:13 ConnInfo assumes signed char Oliver Elphick <olly@lfix.co.uk>
@ 2003-02-08 17:16 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2003-02-08 17:16 UTC (permalink / raw)
  To: Oliver Elphick <olly@lfix.co.uk>; +Cc: pgsql-odbc

Oliver Elphick <olly@lfix.co.uk> writes:
> ConnInfo, defined in connection.h, assumes that char = signed char.

I agree, this is a genuine bug.  It appears to have been introduced
post-7.2, as the ODBC sources in the REL7_2 branch don't seem to
try to assign negative values to these fields.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: ConnInfo assumes signed char
  2003-02-07 18:13 ConnInfo assumes signed char Oliver Elphick <olly@lfix.co.uk>
@ 2003-02-10 06:59 ` Hiroshi Inoue <Inoue@tpf.co.jp>
  1 sibling, 0 replies; 3+ messages in thread

From: Hiroshi Inoue @ 2003-02-10 06:59 UTC (permalink / raw)
  To: Oliver Elphick <olly@lfix.co.uk>; +Cc: pgsql-odbc

Oliver Elphick wrote:
> 
> ConnInfo, defined in connection.h, assumes that char = signed char.
> 
> This is not true of Linux on arm, powerpc and s390, and possibly other
> platforms.  As a result:
> 
> gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c dlg_specific.c -MT dlg_specific.lo -MD -MP -MF .deps/dlg_specific.TPlo  -fPIC -DPIC -o dlg_specific.lo
> dlg_specific.c: In function `getDSNdefaults':
> dlg_specific.c:398: warning: comparison is always false due to limited range of data type
> dlg_specific.c:400: warning: comparison is always false due to limited range of data type
> dlg_specific.c:402: warning: comparison is always false due to limited range of data type
> dlg_specific.c:404: warning: comparison is always false due to limited range of data type
> dlg_specific.c:406: warning: comparison is always false due to limited range of data type
> dlg_specific.c: In function `getDSNinfo':
> dlg_specific.c:484: warning: comparison is always false due to limited range of data type
> dlg_specific.c:491: warning: comparison is always false due to limited range of data type
> dlg_specific.c:498: warning: comparison is always false due to limited range of data type
> dlg_specific.c:505: warning: comparison is always false due to limited range of data type
> dlg_specific.c:512: warning: comparison is always false due to limited range of data type
> 
> The problem still exists in current CVS.
> 
> Where char may contain a negative value, it should explicitly be
> declared as signed char.

OK I changed them to *signed char*s (maybe).
Thanks.

regards,
Hiroshi Inoue
	http://www.geocities.jp/inocchichichi/psqlodbc/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-02-10 06:59 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-07 18:13 ConnInfo assumes signed char Oliver Elphick <olly@lfix.co.uk>
2003-02-08 17:16 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-02-10 06:59 ` Hiroshi Inoue <Inoue@tpf.co.jp>

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