Skip to Content.
Sympa Menu

freetds - [freetds] warnings and oddities

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: 'TDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: [freetds] warnings and oddities
  • Date: Mon, 8 Dec 2003 17:37:52 -0500

I might be the first person to compile yesterday's snapshow with gcc 3.3 on
Tru64. It griped 114 warnings, and some apparent misdetections, too.
Attached.

Some of the complaints are about not declaring vsnprintf(3), even though
it's installed and recognized by configure. Evidence below.

There are some warnings I just don't know how to avoid, and some I think we
should advise be turned off, e.g.:

replacements/iconv.c:200: warning: cast from pointer to integer of different
size

That line is:

if ((int)cd == UCS2LE_ASCII && !isascii(**inbuf)) {

We know perfectly well that "cd", while declared an iconv_t, contains an
enumerated value, an int. So we *cast* it, and still the warning? What
warning-proof syntax can we use?

Here's my favorite:

tds/config.c:810: warning: subscript has type `char'

Uh huh. Rules of the game are that a C char is implicitly promoted to int,
and sizeof(char)<=sizeof(int) on *every* platform. It can't be an issue
unless the array has >127 elements.

<<warnings.txt>> Anyway, the whole list is attached for your perusal.

--jkl

Setup:

$ uname -a
OSF1 dec050.beehive.com V4.0 1530 alpha
$ ../configure --prefix=/usr/users/jklowden/local --with-tdsver=7.0
--disable-libiconv

Installed flavors of printf:

$ nm /usr/lib/libc.a |grep ^[a-z]*printf |cut -f1 -d' ' |sort |uniq
fprintf
fwprintf
printf
snprintf
sprintf
swprintf
vfprintf
vfwprintf
vprintf
vsnprintf
vsprintf
vswprintf
vwprintf
wprintf

$ grep -i print include/config.h
/* Define to 1 if you have the `asprintf' function. */
/* #undef HAVE_ASPRINTF */
/* Define to 1 if you have the `vasprintf' function. */
/* #undef HAVE_VASPRINTF */
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
/* Define to 1 if you have the `_bprintf' function. */
/* #undef HAVE__BPRINTF */
/* Define to 1 if you have the `_vbprintf' function. */
/* #undef HAVE__VBPRINTF */


-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.

../../../src/replacements/iconv.c:125: warning: cast to pointer from integer
of different size
../../../src/replacements/iconv.c:153: warning: cast from pointer to integer
of different size
../../../src/replacements/iconv.c:178: warning: cast from pointer to integer
of different size
../../../src/replacements/iconv.c:200: warning: cast from pointer to integer
of different size
../../../src/replacements/vasprintf.c:58: warning: implicit declaration of
function `vsnprintf'
../../../src/tds/token.c:1980: warning: cast from pointer to integer of
different size
../../../src/tds/write.c:159: warning: passing arg 5 of `tds_iconv' from
incompatible pointer type
../../../src/tds/write.c:159: warning: passing arg 7 of `tds_iconv' from
incompatible pointer type
../../../src/tds/convert.c:890: warning: long long int format, TDS_INT8 arg
(arg 3)
../../../src/tds/convert.c:949: warning: long long int format, TDS_INT8 arg
(arg 3)
../../../src/tds/convert.c:1715: warning: implicit declaration of function
`strtok_r'
../../../src/tds/convert.c:1715: warning: assignment makes pointer from
integer without a cast
../../../src/tds/convert.c:1904: warning: assignment makes pointer from
integer without a cast
../../../src/tds/config.c:319: warning: subscript has type `char'
../../../src/tds/config.c:330: warning: subscript has type `char'
../../../src/tds/config.c:330: warning: subscript has type `char'
../../../src/tds/config.c:332: warning: subscript has type `char'
../../../src/tds/config.c:333: warning: subscript has type `char'
../../../src/tds/config.c:344: warning: subscript has type `char'
../../../src/tds/config.c:351: warning: subscript has type `char'
../../../src/tds/config.c:351: warning: subscript has type `char'
../../../src/tds/config.c:353: warning: subscript has type `char'
../../../src/tds/config.c:368: warning: subscript has type `char'
../../../src/tds/config.c:810: warning: subscript has type `char'
../../../src/tds/config.c:811: warning: implicit declaration of function
`strtok_r'
../../../src/tds/config.c:811: warning: assignment makes pointer from integer
without a cast
../../../src/tds/config.c:817: warning: subscript has type `char'
../../../src/tds/config.c:818: warning: assignment makes pointer from integer
without a cast
../../../src/tds/config.c:820: warning: assignment makes pointer from integer
without a cast
../../../src/tds/config.c:823: warning: assignment makes pointer from integer
without a cast
../../../src/tds/config.c:824: warning: assignment makes pointer from integer
without a cast
../../../src/tds/config.c:825: warning: assignment makes pointer from integer
without a cast
../../../src/tds/config.c:833: warning: assignment makes pointer from integer
without a cast
../../../src/tds/config.c:835: warning: assignment makes pointer from integer
without a cast
../../../src/tds/config.c:838: warning: assignment makes pointer from integer
without a cast
../../../src/tds/iconv.c:731: warning: passing arg 3 of `iconv' from
incompatible pointer type
../../../src/tds/vstrbuild.c:116: warning: implicit declaration of function
`strtok_r'
../../../src/tds/vstrbuild.c:116: warning: assignment makes pointer from
integer without a cast
../../../src/tds/vstrbuild.c:116: warning: assignment makes pointer from
integer without a cast
../../../src/ctlib/ct.c:134: warning: implicit declaration of function
`asprintf'
../../../src/dblib/bcp.c:950: warning: passing arg 6 of `tds_iconv_fread'
from incompatible pointer type
../../../src/dblib/bcp.c:1738: warning: implicit declaration of function
`asprintf'
../../../src/odbc/odbc.c:564: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../../src/odbc/odbc.c:579: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../../src/odbc/odbc.c:581: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../../src/odbc/odbc.c:715: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:723: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:727: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:1438: warning: pointer type mismatch in conditional
expression
../../../src/odbc/odbc.c:1441: warning: pointer type mismatch in conditional
expression
../../../src/odbc/odbc.c:1447: warning: pointer type mismatch in conditional
expression
../../../src/odbc/odbc.c:1487: warning: pointer type mismatch in conditional
expression
../../../src/odbc/odbc.c:1495: warning: pointer type mismatch in conditional
expression
../../../src/odbc/odbc.c:1498: warning: pointer type mismatch in conditional
expression
../../../src/odbc/odbc.c:1501: warning: pointer type mismatch in conditional
expression
../../../src/odbc/odbc.c:1507: warning: pointer type mismatch in conditional
expression
../../../src/odbc/odbc.c:1538: warning: pointer type mismatch in conditional
expression
../../../src/odbc/odbc.c:1544: warning: pointer type mismatch in conditional
expression
../../../src/odbc/odbc.c:1550: warning: pointer type mismatch in conditional
expression
../../../src/odbc/odbc.c:1960: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:1972: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:1977: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2015: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2017: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2039: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2071: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2074: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2080: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2085: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2087: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2095: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2106: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2115: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:2322: warning: subscript has type `char'
../../../src/odbc/odbc.c:4523: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:4564: warning: cast to pointer from integer of
different size
../../../src/odbc/odbc.c:4609: warning: cast to pointer from integer of
different size
../../../src/odbc/odbc.c:4615: warning: cast from pointer to integer of
different size
../../../src/odbc/odbc.c:4821: warning: cast to pointer from integer of
different size
../../../src/odbc/connectparams.c:212: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../src/odbc/connectparams.c:256: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../src/odbc/connectparams.c:264: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../src/odbc/connectparams.c:271: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../src/odbc/connectparams.c:289: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../src/odbc/connectparams.c:291: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../src/odbc/connectparams.c:295: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../src/odbc/connectparams.c:297: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../src/odbc/connectparams.c:303: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../src/odbc/connectparams.c:304: warning: dereferencing type-punned
pointer will break strict-aliasing rules
../../../src/odbc/native.c:102: warning: subscript has type `char'
../../../src/odbc/native.c:106: warning: subscript has type `char'
../../../src/odbc/native.c:108: warning: subscript has type `char'
../../../src/odbc/native.c:177: warning: subscript has type `char'
../../../src/odbc/native.c:180: warning: subscript has type `char'
../../../src/odbc/native.c:182: warning: subscript has type `char'
../../../src/odbc/native.c:187: warning: subscript has type `char'
../../../src/odbc/native.c:195: warning: subscript has type `char'
../../../src/odbc/native.c:201: warning: subscript has type `char'
../../../src/odbc/native.c:206: warning: subscript has type `char'
../../../src/odbc/error.c:482: warning: implicit declaration of function
`asprintf'
../../../src/apps/freebcp.c:148: warning: subscript has type `char'
../../../src/server/login.c:117: warning: dereferencing type-punned pointer
will break strict-aliasing rules
../../../src/server/login.c:139: warning: dereferencing type-punned pointer
will break strict-aliasing rules
../../../src/server/login.c:140: warning: dereferencing type-punned pointer
will break strict-aliasing rules
../../../src/server/login.c:211: warning: passing arg 5 of `tds_iconv' from
incompatible pointer type
../../../src/server/login.c:211: warning: passing arg 7 of `tds_iconv' from
incompatible pointer type
../../../src/pool/config.c:80: warning: subscript has type `char'
../../../src/pool/config.c:113: warning: subscript has type `char'
../../../src/pool/config.c:124: warning: subscript has type `char'
../../../src/pool/config.c:126: warning: subscript has type `char'
../../../src/pool/config.c:127: warning: subscript has type `char'
../../../src/pool/config.c:138: warning: subscript has type `char'
../../../src/pool/config.c:145: warning: subscript has type `char'
../../../src/pool/config.c:147: warning: subscript has type `char'



Archive powered by MHonArc 2.6.24.

Top of Page