[unixODBC-dev] Lots of warnings, and an outright error, in 2.2.14 on 64-bit

Tom Lane tgl at sss.pgh.pa.us
Mon Feb 16 16:37:18 GMT 2009

Nick Gorham <nick at lurcher.org> writes:
> Tom Lane wrote:
>> Note there are several things that look to be outright bugs
>> independently of platform word width, such as uninitialized variables
>> and use of "==" where "=" was presumably meant.

> Just checking, do you mean in the odbctest code? I can believe missing 
> the arg change to SQLExtendedFetch, but outright bugs supprise me (maybe 
> one, but lots of them?)

DriverManager/SQLCopyDesc.c has a whole lot of "ret == SQLGETDESCFIELD(..."
that look like they must have been meant as "=" instead.  Maybe that
only counts as one bug ;-).  There's another case in cur/SQLExtendedFetch.c.

The uninitialized-variable cases I fixed are in
DriverManager/SQLColAttributesW.c and DriverManager/SQLGetDiagField.c,
and IIRC would only trigger on zero-length input, so maybe no one has
stumbled across them up to now.

There are also some error messages that pass an integer value to a %s
format specifier, which would certainly crash if they'd ever been

The bulk of the patch is word-width issues in debugging sprintf's, which
quite likely wouldn't ever bother users in the field, but they'd sure
matter if you tried to do debugging on a 64-bit platform.

Every change that I made was in response to a "gcc -Wall" warning.
If you don't customarily use -Wall or a similar warning level from
another equally picky compiler, I recommend it.  Zero tolerance for
warnings has saved my butt a few times.

			regards, tom lane

More information about the unixODBC-dev mailing list