Re: Lots of warnings, and an outright error, in 2.2.14 on 64-bit

Tom Lane <[email protected]>
Newsgroups gmane.comp.db.unixodbc.devel
Message-ID <[email protected]>
Nick Gorham <[email protected]> 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
executed.

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
_______________________________________________
unixODBC-dev mailing list
[email protected]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.