pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedCompiler warnings in psqloodbc 08.03.0200
6+ messages / 3 participants
[nested] [flat]
* Compiler warnings in psqloodbc 08.03.0200
@ 2008-09-16 13:12 Tom Lane <tgl@sss.pgh.pa.us>
2008-09-16 14:45 ` Re: Compiler warnings in psqloodbc 08.03.0200 Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2008-09-16 13:12 UTC (permalink / raw)
To: pgsql-odbc
I wrote:
> BTW, isn't anyone paying attention to compiler warnings in this code base?
To be concrete, attached is a list of warnings I see when building .0200
using gcc -Wall on an x86_64 Fedora 9 machine. If I were in charge of
this project I'd insist on every one of these being cleaned up --- they
are at least evidence of sloppy programming, and a significant fraction
look like they mean certain crashes if the code ever gets executed.
BTW, I've omitted 261 "pointer targets differ in signedness" warnings...
those are probably not interesting, but I'd still recommend cleaning
them up, if only so that more important warnings don't get lost in the
noise. The core Postgres project has maintained a zero-tolerance policy
on gcc warnings for years, and I think it's served us well.
regards, tom lane
info.c: In function 'PGAPI_GetInfo':
info.c:827: warning: label 'cleanup' defined but not used
info.c: In function 'PGAPI_GetTypeInfo':
info.c:972: warning: label 'cleanup' defined but not used
info.c: In function 'PGAPI_Tables':
info.c:1919: warning: the address of 'table_name' will always evaluate as 'true'
info.c: In function 'PGAPI_Statistics':
info.c:2935: warning: unused variable 'relkind'
info.c: In function 'PGAPI_ColumnPrivileges':
info.c:3487: warning: label 'cleanup' defined but not used
bind.c: In function 'PGAPI_NumParams':
bind.c:449: warning: unused variable 'dollar_quote'
bind.c:449: warning: unused variable 'identifier_quote'
bind.c:449: warning: unused variable 'literal_quote'
bind.c: In function 'CountParameters':
bind.c:626: warning: unused variable 'func'
connection.c: In function 'CC_Constructor':
connection.c:360: warning: implicit declaration of function 'isMsAccess'
connection.c: In function 'CC_create_errormsg':
connection.c:2091: warning: the address of 'msg' will always evaluate as 'true'
connection.c: In function 'LIBPQ_connect':
connection.c:3704: warning: unused variable 'on'
connection.c: In function 'CurrCat':
connection.c:3781: warning: implicit declaration of function 'isMsQuery'
connection.c: At top level:
connection.c:256: warning: 'CC_globals_init' defined but not used
convert.c: In function 'copy_statement_with_parameters':
convert.c:2512: warning: the address of 'curname' will always evaluate as 'true'
convert.c: In function 'ResolveNumericParam':
convert.c:3236: warning: '0' flag ignored with precision and '%d' printf format
convert.c: In function 'prep_params':
convert.c:2302: warning: 'srvquery' may be used uninitialized in this function
convert.c:2302: warning: 'orgquery' may be used uninitialized in this function
convert.c: In function 'convert_escape':
convert.c:4328: warning: 'param_consumed' may be used uninitialized in this function
drvconn.c: In function 'dconn_get_connect_attributes':
drvconn.c:492: warning: passing argument 1 of 'dconn_get_attributes' from incompatible pointer type
drvconn.c: In function 'dconn_get_common_attributes':
drvconn.c:498: warning: passing argument 1 of 'dconn_get_attributes' from incompatible pointer type
drvconn.c: In function 'dconn_get_attributes':
drvconn.c:430: warning: 'last' may be used uninitialized in this function
environ.c: In function 'EN_Constructor':
environ.c:534: warning: label 'cleanup' defined but not used
environ.c:509: warning: unused variable 'func'
execute.c: In function 'PGAPI_Execute':
execute.c:971: warning: implicit declaration of function 'isSqlServr'
options.c: In function 'PGAPI_SetConnectOption':
options.c:503: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c:509: warning: cast to pointer from integer of different size
options.c: In function 'PGAPI_GetConnectOption':
options.c:581: warning: cast from pointer to integer of different size
pgtypes.c: In function 'getCharColumnSize':
pgtypes.c:721: warning: implicit declaration of function 'isSqlServr'
pgtypes.c: At top level:
pgtypes.c:808: warning: 'getTimestampMaxDecimalDigits' defined but not used
psqlodbc.c: In function 'getMutexAttr':
psqlodbc.c:55: warning: implicit declaration of function 'pthread_mutexattr_settype'
psqlodbc.c: At top level:
psqlodbc.c:96: warning: 'finalize_global_cs' defined but not used
qresult.c: In function 'QR_next_tuple':
qresult.c:869: warning: format '%lu' expects type 'long unsigned int *', but argument 3 has type 'SQLUINTEGER *'
qresult.c:920: warning: format '%lu' expects type 'long unsigned int *', but argument 3 has type 'SQLUINTEGER *'
results.c: At top level:
results.c:2093: warning: 'tupleIsAdding' defined but not used
results.c:2113: warning: 'tupleIsUpdating' defined but not used
results.c:2137: warning: 'tupleIsDeleting' defined but not used
results.c:2719: warning: 'IndexExists' defined but not used
socket.c:186: warning: initialization from incompatible pointer type
socket.c: In function 'format_sockerr':
socket.c:206: warning: cast to pointer from integer of different size
socket.c: In function 'SOCK_wait_for_ready':
socket.c:468: warning: 'no_timeout' may be used uninitialized in this function
parse.c: In function 'CheckHasOids':
parse.c:392: warning: too few arguments for format
parse.c:393: warning: the address of 'query' will always evaluate as 'true'
parse.c:413: warning: the address of 'query' will always evaluate as 'true'
parse.c: At top level:
parse.c:548: warning: return type defaults to 'int'
parse.c: In function 'SC_set_SS_columnkey':
parse.c:993: warning: passing argument 2 of 'PGAPI_AllocStmt' from incompatible pointer type
parse.c: In function 'parse_the_statement':
parse.c:1178: warning: cast to pointer from integer of different size
parse.c:1313: warning: the address of 'token' will always evaluate as 'true'
parse.c:1438: warning: the address of 'token' will always evaluate as 'true'
parse.c:1468: warning: the address of 'token' will always evaluate as 'true'
parse.c:1485: warning: the address of 'token' will always evaluate as 'true'
parse.c:1610: warning: the address of 'token' will always evaluate as 'true'
parse.c:1687: warning: the address of 'token' will always evaluate as 'true'
parse.c:1710: warning: the address of 'token' will always evaluate as 'true'
parse.c:1135: warning: 'allocated_size' may be used uninitialized in this function
parse.c:1142: warning: 'column_has_alias' may be used uninitialized in this function
parse.c:1139: warning: 'parse' may be used uninitialized in this function
statement.c: In function 'SendParseRequest':
statement.c:2490: warning: 'end_pidx' may be used uninitialized in this function
statement.c:2490: warning: 'sta_pidx' may be used uninitialized in this function
dlg_specific.c: In function 'getDSNinfo':
dlg_specific.c:896: warning: pointer type mismatch in conditional expression
dlg_specific.c: In function 'writeDriverCommoninfo':
dlg_specific.c:915: warning: comparison with string literal results in unspecified behavior
multibyte.c: In function 'pg_CS_code':
multibyte.c:85: warning: unused variable 'len'
multibyte.c: In function 'get_environment_encoding':
multibyte.c:515: warning: unused variable 'acp'
descriptor.c: In function 'TI_Constructor':
descriptor.c:36: warning: the address of 'qual' will always evaluate as 'true'
descriptor.c: In function 'DC_create_errorinfo':
descriptor.c:587: warning: unused variable 'func'
pgapi30.c: In function 'PGAPI_GetConnectAttr':
pgapi30.c:401: warning: unused variable 'func'
pgapi30.c: In function 'PGAPI_SetConnectAttr':
pgapi30.c:1667: warning: cast from pointer to integer of different size
pgapi30.c: In function 'PGAPI_SetStmtAttr':
pgapi30.c:1870: warning: cast from pointer to integer of different size
pgapi30.c:1873: warning: cast from pointer to integer of different size
mylog.c: In function 'forcelog':
mylog.c:253: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'pthread_t'
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Compiler warnings in psqloodbc 08.03.0200
2008-09-16 13:12 Compiler warnings in psqloodbc 08.03.0200 Tom Lane <tgl@sss.pgh.pa.us>
@ 2008-09-16 14:45 ` Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
2008-09-29 10:03 ` Re: Compiler warnings in psqloodbc 08.03.0200 Zoltan Boszormenyi <zb@cybertec.at>
0 siblings, 1 reply; 6+ messages in thread
From: Hiroshi Saito @ 2008-09-16 14:45 UTC (permalink / raw)
To: pgsql-odbc; Tom Lane <tgl@sss.pgh.pa.us>
Hi.
Surely, we have not made offer sufficient about x86_64.... However, The check of operation
was performed by the temporary rental machine. Moreover, there is also a situation of taking
time in the check of the present BIGENDIAN. Then, late work may be blamed....
Anyway, In order to avoid a problem, to be warning should clear.
BTW, FreeBSD x86 is this.
inet% gmake socket.o
if
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/local/pgsql/include -Wall -g -O2
-MT socket.o -MD -MP -MF ".deps/socket.Tpo" -c -o socket.o socket.c; \
then mv -f ".deps/socket.Tpo" ".deps/socket.Po"; else rm -f ".deps/socket.Tpo"; exit 1; fi
socket.c: In function `SOCK_wait_for_ready':
socket.c:468: warning: 'no_timeout' might be used uninitialized in this function
Regards,
Hiroshi Saito
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
>I wrote:
>> BTW, isn't anyone paying attention to compiler warnings in this code base?
>
> To be concrete, attached is a list of warnings I see when building .0200
> using gcc -Wall on an x86_64 Fedora 9 machine. If I were in charge of
> this project I'd insist on every one of these being cleaned up --- they
> are at least evidence of sloppy programming, and a significant fraction
> look like they mean certain crashes if the code ever gets executed.
>
> BTW, I've omitted 261 "pointer targets differ in signedness" warnings...
> those are probably not interesting, but I'd still recommend cleaning
> them up, if only so that more important warnings don't get lost in the
> noise. The core Postgres project has maintained a zero-tolerance policy
> on gcc warnings for years, and I think it's served us well.
>
> regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Compiler warnings in psqloodbc 08.03.0200
2008-09-16 13:12 Compiler warnings in psqloodbc 08.03.0200 Tom Lane <tgl@sss.pgh.pa.us>
2008-09-16 14:45 ` Re: Compiler warnings in psqloodbc 08.03.0200 Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
@ 2008-09-29 10:03 ` Zoltan Boszormenyi <zb@cybertec.at>
2008-09-29 10:05 ` Re: Compiler warnings in psqloodbc 08.03.0200 Zoltan Boszormenyi <zb@cybertec.at>
0 siblings, 1 reply; 6+ messages in thread
From: Zoltan Boszormenyi @ 2008-09-29 10:03 UTC (permalink / raw)
To: Hiroshi Saito <z-saito@guitar.ocn.ne.jp>; +Cc: pgsql-odbc@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>; Hans-Juergen Schoenig <hs@cybertec.at>
Hi,
here's the fix for all non-pointer-signedness warnings,
against 08.03.0300 that was released meanwhile. Now
the compilation only emits 246 "differ in signedness"
warnings, which is still too much noise. I agree with
Tom Lane that those should be cleaned up if for nothing
else, than the real bugs don't get lost in the noise.
The patch cleans up such warnings in several files:
"label 'cleanup' defined but not used" and
"unused variable 'func'"
In convert.c::convert_escape():
"'param_consumed' may be used uninitialized in this function"
The variable "param_consumed" was not assigned a value
in all cases by processParameters() upon returning,
so I tried to fix it there. Now it does, please review.
In descriptor.c::TI_Constructor():
"the address of 'qual' will always evaluate as 'true'"
STRX_TO_NAME() has to be used instead of STR_TO_NAME.
In drvconn.c::dconn_get_attributes():
"'last' may be used uninitialized in this function"
The first parameter to strtok_r() may be NULL if
strdup() returns NULL. In that case strtok_r() may
corrupt unknown memory areas.
In pgapi30.c, two instances of
"cast from pointer to integer of different size"
In psqlodbc.c()::finalize_global_cs() is only used inside
"#ifdef WIN32" but was defined outside causing a
"defined but not used" warning.
Some notes:
- Instead of using 'CSTR func = "funcname";' everywhere,
it would be better to use the __FUNCTION__ pre-processor
macro. This way, the "unused variable 'func'" is eliminated
once and for all as __FUNCTION__ is available everywhere.
- The sea of "differ in signedness" warnings are caused by
the difference of "{SQL|U}CHAR *" and plain "char *".
Many ODBC API calls expect "SQLCHAR *" input.
Using strcpy(), strcmp(), etc. on them causes warnings.
Many internal psqlODBC functions expect a character input
and they are also used inconsistenly with different
signed and unsigned parameters.
Either the API parameters has to be treated internally
as "char *" and keep a local variable for this purpose,
or pass the SQLCHAR * down in other functions which
have to be declared with the appropriate header.
Fixing it either way would be quite invasive in terms
of patch size. The latter would mean smaller and
cleaner C source.
Best regards,
Zoltán Böszörményi
Hiroshi Saito írta:
> Hi.
>
> Surely, we have not made offer sufficient about x86_64.... However,
> The check of operation
> was performed by the temporary rental machine. Moreover, there is also
> a situation of taking
> time in the check of the present BIGENDIAN. Then, late work may be
> blamed....
> Anyway, In order to avoid a problem, to be warning should clear.
>
> BTW, FreeBSD x86 is this.
> inet% gmake socket.o
> if gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include
> -I/usr/local/pgsql/include -Wall -g -O2 -MT socket.o -MD -MP -MF
> ".deps/socket.Tpo" -c -o socket.o socket.c; \
> then mv -f ".deps/socket.Tpo" ".deps/socket.Po"; else rm -f
> ".deps/socket.Tpo"; exit 1; fi
> socket.c: In function `SOCK_wait_for_ready':
> socket.c:468: warning: 'no_timeout' might be used uninitialized in
> this function
>
> Regards,
> Hiroshi Saito
>
> ----- Original Message ----- From: "Tom Lane" <tgl@sss.pgh.pa.us>
>
>
>> I wrote:
>>> BTW, isn't anyone paying attention to compiler warnings in this code
>>> base?
>>
>> To be concrete, attached is a list of warnings I see when building .0200
>> using gcc -Wall on an x86_64 Fedora 9 machine. If I were in charge of
>> this project I'd insist on every one of these being cleaned up --- they
>> are at least evidence of sloppy programming, and a significant fraction
>> look like they mean certain crashes if the code ever gets executed.
>>
>> BTW, I've omitted 261 "pointer targets differ in signedness" warnings...
>> those are probably not interesting, but I'd still recommend cleaning
>> them up, if only so that more important warnings don't get lost in the
>> noise. The core Postgres project has maintained a zero-tolerance policy
>> on gcc warnings for years, and I think it's served us well.
>>
>> regards, tom lane
>
>
--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Compiler warnings in psqloodbc 08.03.0200
2008-09-16 13:12 Compiler warnings in psqloodbc 08.03.0200 Tom Lane <tgl@sss.pgh.pa.us>
2008-09-16 14:45 ` Re: Compiler warnings in psqloodbc 08.03.0200 Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
2008-09-29 10:03 ` Re: Compiler warnings in psqloodbc 08.03.0200 Zoltan Boszormenyi <zb@cybertec.at>
@ 2008-09-29 10:05 ` Zoltan Boszormenyi <zb@cybertec.at>
2008-09-30 13:32 ` Re: Compiler warnings in psqloodbc 08.03.0200 Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
0 siblings, 1 reply; 6+ messages in thread
From: Zoltan Boszormenyi @ 2008-09-29 10:05 UTC (permalink / raw)
To: Hiroshi Saito <z-saito@guitar.ocn.ne.jp>; +Cc: pgsql-odbc@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>; Hans-Juergen Schoenig <hs@cybertec.at>
Oops, the actual fix is attached.
Zoltan Boszormenyi írta:
> Hi,
>
> here's the fix for all non-pointer-signedness warnings,
> against 08.03.0300 that was released meanwhile. Now
> the compilation only emits 246 "differ in signedness"
> warnings, which is still too much noise. I agree with
> Tom Lane that those should be cleaned up if for nothing
> else, than the real bugs don't get lost in the noise.
>
> The patch cleans up such warnings in several files:
> "label 'cleanup' defined but not used" and
> "unused variable 'func'"
>
> In convert.c::convert_escape():
> "'param_consumed' may be used uninitialized in this function"
> The variable "param_consumed" was not assigned a value
> in all cases by processParameters() upon returning,
> so I tried to fix it there. Now it does, please review.
>
> In descriptor.c::TI_Constructor():
> "the address of 'qual' will always evaluate as 'true'"
> STRX_TO_NAME() has to be used instead of STR_TO_NAME.
>
> In drvconn.c::dconn_get_attributes():
> "'last' may be used uninitialized in this function"
> The first parameter to strtok_r() may be NULL if
> strdup() returns NULL. In that case strtok_r() may
> corrupt unknown memory areas.
>
> In pgapi30.c, two instances of
> "cast from pointer to integer of different size"
>
> In psqlodbc.c()::finalize_global_cs() is only used inside
> "#ifdef WIN32" but was defined outside causing a
> "defined but not used" warning.
>
> Some notes:
> - Instead of using 'CSTR func = "funcname";' everywhere,
> it would be better to use the __FUNCTION__ pre-processor
> macro. This way, the "unused variable 'func'" is eliminated
> once and for all as __FUNCTION__ is available everywhere.
> - The sea of "differ in signedness" warnings are caused by
> the difference of "{SQL|U}CHAR *" and plain "char *".
> Many ODBC API calls expect "SQLCHAR *" input.
> Using strcpy(), strcmp(), etc. on them causes warnings.
> Many internal psqlODBC functions expect a character input
> and they are also used inconsistenly with different
> signed and unsigned parameters.
> Either the API parameters has to be treated internally
> as "char *" and keep a local variable for this purpose,
> or pass the SQLCHAR * down in other functions which
> have to be declared with the appropriate header.
> Fixing it either way would be quite invasive in terms
> of patch size. The latter would mean smaller and
> cleaner C source.
>
> Best regards,
> Zoltán Böszörményi
>
> Hiroshi Saito írta:
>
>> Hi.
>>
>> Surely, we have not made offer sufficient about x86_64.... However,
>> The check of operation
>> was performed by the temporary rental machine. Moreover, there is also
>> a situation of taking
>> time in the check of the present BIGENDIAN. Then, late work may be
>> blamed....
>> Anyway, In order to avoid a problem, to be warning should clear.
>>
>> BTW, FreeBSD x86 is this.
>> inet% gmake socket.o
>> if gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include
>> -I/usr/local/pgsql/include -Wall -g -O2 -MT socket.o -MD -MP -MF
>> ".deps/socket.Tpo" -c -o socket.o socket.c; \
>> then mv -f ".deps/socket.Tpo" ".deps/socket.Po"; else rm -f
>> ".deps/socket.Tpo"; exit 1; fi
>> socket.c: In function `SOCK_wait_for_ready':
>> socket.c:468: warning: 'no_timeout' might be used uninitialized in
>> this function
>>
>> Regards,
>> Hiroshi Saito
>>
>> ----- Original Message ----- From: "Tom Lane" <tgl@sss.pgh.pa.us>
>>
>>
>>
>>> I wrote:
>>>
>>>> BTW, isn't anyone paying attention to compiler warnings in this code
>>>> base?
>>>>
>>> To be concrete, attached is a list of warnings I see when building .0200
>>> using gcc -Wall on an x86_64 Fedora 9 machine. If I were in charge of
>>> this project I'd insist on every one of these being cleaned up --- they
>>> are at least evidence of sloppy programming, and a significant fraction
>>> look like they mean certain crashes if the code ever gets executed.
>>>
>>> BTW, I've omitted 261 "pointer targets differ in signedness" warnings...
>>> those are probably not interesting, but I'd still recommend cleaning
>>> them up, if only so that more important warnings don't get lost in the
>>> noise. The core Postgres project has maintained a zero-tolerance policy
>>> on gcc warnings for years, and I think it's served us well.
>>>
>>> regards, tom lane
>>>
>>
>
>
>
--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
Attachments:
psqlodbc-08.03.0300-warningfixes.patch (text/x-patch, 6.1K) download
diff -durpN psqlodbc-08.03.0300.orig/bind.c psqlodbc-08.03.0300/bind.c
--- psqlodbc-08.03.0300.orig/bind.c 2008-09-22 12:13:05.000000000 +0200
+++ psqlodbc-08.03.0300/bind.c 2008-09-29 10:25:18.000000000 +0200
@@ -620,7 +620,9 @@ reset_a_iparameter_binding(IPDFields *se
int
CountParameters(const StatementClass *self, Int2 *inputCount, Int2 *ioCount, Int2 *outputCount)
{
+#if 0
CSTR func = "CountParameters";
+#endif
IPDFields *ipdopts = SC_get_IPDF(self);
int i, num_params, valid_count;
diff -durpN psqlodbc-08.03.0300.orig/convert.c psqlodbc-08.03.0300/convert.c
--- psqlodbc-08.03.0300.orig/convert.c 2008-09-25 14:25:03.000000000 +0200
+++ psqlodbc-08.03.0300/convert.c 2008-09-29 09:45:04.000000000 +0200
@@ -4157,18 +4157,23 @@ processParameters(QueryParse *qp, QueryB
size_t *output_count, SQLLEN param_pos[][2])
{
CSTR func = "processParameters";
- int retval, innerParenthesis, param_count;
+ int retval, innerParenthesis, param_count, return_count;
BOOL stop;
/* begin with outer '(' */
innerParenthesis = 0;
param_count = 0;
+ return_count = 0;
stop = FALSE;
for (; F_OldPos(qp) < qp->stmt_len; F_OldNext(qp))
{
retval = inner_process_tokens(qp, qb);
if (retval == SQL_ERROR)
+ {
+ if (output_count)
+ *output_count = return_count;
return retval;
+ }
if (ENCODE_STATUS(qp->encstr) != 0)
continue;
if (qp->in_identifier || qp->in_literal || qp->in_escape)
@@ -4203,8 +4208,7 @@ processParameters(QueryParse *qp, QueryB
param_pos[param_count][0] =
param_pos[param_count][1] = -1;
}
- if (output_count)
- *output_count = F_NewPos(qb);
+ return_count = F_NewPos(qb);
break;
case '}':
@@ -4215,6 +4219,8 @@ processParameters(QueryParse *qp, QueryB
if (stop) /* returns with the last } position */
break;
}
+ if (output_count)
+ *output_count = return_count;
if (param_pos[param_count][0] >= 0)
{
mylog("%s closing ) not found %d\n", func, innerParenthesis);
diff -durpN psqlodbc-08.03.0300.orig/descriptor.c psqlodbc-08.03.0300/descriptor.c
--- psqlodbc-08.03.0300.orig/descriptor.c 2007-11-26 13:24:10.000000000 +0100
+++ psqlodbc-08.03.0300/descriptor.c 2008-09-29 10:50:49.000000000 +0200
@@ -33,7 +33,7 @@ void TI_Constructor(TABLE_INFO *self, co
STR_TO_NAME(self->bestitem, OID_NAME);
sprintf(qual, "\"%s\" = %%u", OID_NAME);
- STR_TO_NAME(self->bestqual, qual);
+ STRX_TO_NAME(self->bestqual, qual);
TI_set_hasoids(self);
TI_set_hasoids_checked(self);
}
@@ -584,7 +584,9 @@ static struct
static PG_ErrorInfo *DC_create_errorinfo(const DescriptorClass *desc)
{
+#if 0
CSTR func = "DC_create_erroinfo";
+#endif
PG_ErrorInfo *error;
ConnectionClass *conn;
EnvironmentClass *env;
diff -durpN psqlodbc-08.03.0300.orig/drvconn.c psqlodbc-08.03.0300/drvconn.c
--- psqlodbc-08.03.0300.orig/drvconn.c 2008-09-22 12:13:12.000000000 +0200
+++ psqlodbc-08.03.0300/drvconn.c 2008-09-29 11:10:17.000000000 +0200
@@ -432,6 +432,8 @@ dconn_get_attributes(copyfunc func, cons
our_connect_string = strdup(connect_string);
strtok_arg = our_connect_string;
+ if (strtok_arg == NULL)
+ return;
#ifdef FORCE_PASSWORD_DISPLAY
mylog("our_connect_string = '%s'\n", our_connect_string);
diff -durpN psqlodbc-08.03.0300.orig/environ.c psqlodbc-08.03.0300/environ.c
--- psqlodbc-08.03.0300.orig/environ.c 2007-11-26 13:24:10.000000000 +0100
+++ psqlodbc-08.03.0300/environ.c 2008-09-29 10:25:47.000000000 +0200
@@ -531,7 +531,7 @@ EN_Constructor(void)
#endif /* WIN32 */
rv = (EnvironmentClass *) malloc(sizeof(EnvironmentClass));
-cleanup:
+
if (rv)
{
rv->errormsg = 0;
diff -durpN psqlodbc-08.03.0300.orig/info.c psqlodbc-08.03.0300/info.c
--- psqlodbc-08.03.0300.orig/info.c 2008-09-25 14:25:05.000000000 +0200
+++ psqlodbc-08.03.0300/info.c 2008-09-29 10:24:34.000000000 +0200
@@ -824,7 +824,6 @@ mylog("CONVERT_FUNCTIONS=" FORMAT_ULEN "
if (pcbInfoValue)
*pcbInfoValue = (SQLSMALLINT) len;
-cleanup:
return result;
}
@@ -969,7 +968,6 @@ inolog("serial in\n");
}
}
-cleanup:
#undef return
/*
* also, things need to think that this statement is finished so the
@@ -3484,7 +3482,7 @@ PGAPI_ColumnPrivileges(
extend_column_bindings(SC_get_ARDF(stmt), 8);
/* set up the current tuple pointer for SQLFetch */
result = SQL_SUCCESS;
-cleanup:
+
/* set up the current tuple pointer for SQLFetch */
stmt->status = STMT_FINISHED;
stmt->currTuple = -1;
diff -durpN psqlodbc-08.03.0300.orig/pgapi30.c psqlodbc-08.03.0300/pgapi30.c
--- psqlodbc-08.03.0300.orig/pgapi30.c 2008-09-25 14:25:06.000000000 +0200
+++ psqlodbc-08.03.0300/pgapi30.c 2008-09-29 10:54:39.000000000 +0200
@@ -398,7 +398,9 @@ PGAPI_GetConnectAttr(HDBC ConnectionHand
SQLINTEGER Attribute, PTR Value,
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
{
+#if 0
CSTR func = "PGAPI_GetConnectAttr";
+#endif
ConnectionClass *conn = (ConnectionClass *) ConnectionHandle;
RETCODE ret = SQL_SUCCESS;
SQLINTEGER len = 4;
@@ -1664,7 +1666,7 @@ PGAPI_SetConnectAttr(HDBC ConnectionHand
unsupported = TRUE;
break;
default:
- ret = PGAPI_SetConnectOption(ConnectionHandle, (SQLUSMALLINT) Attribute, (SQLLEN) Value);
+ ret = PGAPI_SetConnectOption(ConnectionHandle, (SQLUSMALLINT) Attribute, CAST_PTR(SQLLEN, Value));
}
if (unsupported)
{
@@ -1870,7 +1872,7 @@ inolog("set ard=%p\n", stmt->ard);
SC_get_ARDF(stmt)->size_of_rowset = CAST_UPTR(SQLULEN, Value);
break;
default:
- return PGAPI_SetStmtOption(StatementHandle, (SQLUSMALLINT) Attribute, (SQLULEN) Value);
+ return PGAPI_SetStmtOption(StatementHandle, (SQLUSMALLINT) Attribute, CAST_PTR(SQLULEN, Value));
}
return ret;
}
diff -durpN psqlodbc-08.03.0300.orig/psqlodbc.c psqlodbc-08.03.0300/psqlodbc.c
--- psqlodbc-08.03.0300.orig/psqlodbc.c 2008-05-11 20:42:24.000000000 +0200
+++ psqlodbc-08.03.0300/psqlodbc.c 2008-09-29 11:32:20.000000000 +0200
@@ -92,6 +92,7 @@ int initialize_global_cs(void)
return 0;
}
+#ifdef WIN32
static void finalize_global_cs(void)
{
DELETE_COMMON_CS;
@@ -104,7 +105,6 @@ static void finalize_global_cs(void)
#endif /* _DEBUG */
}
-#ifdef WIN32
HINSTANCE NEAR s_hModule; /* Saved module handle. */
/* This is where the Driver Manager attaches to this Driver */
BOOL WINAPI
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Compiler warnings in psqloodbc 08.03.0200
2008-09-16 13:12 Compiler warnings in psqloodbc 08.03.0200 Tom Lane <tgl@sss.pgh.pa.us>
2008-09-16 14:45 ` Re: Compiler warnings in psqloodbc 08.03.0200 Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
2008-09-29 10:03 ` Re: Compiler warnings in psqloodbc 08.03.0200 Zoltan Boszormenyi <zb@cybertec.at>
2008-09-29 10:05 ` Re: Compiler warnings in psqloodbc 08.03.0200 Zoltan Boszormenyi <zb@cybertec.at>
@ 2008-09-30 13:32 ` Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
2008-09-30 16:56 ` Re: Compiler warnings in psqloodbc 08.03.0200 Zoltan Boszormenyi <zb@cybertec.at>
0 siblings, 1 reply; 6+ messages in thread
From: Hiroshi Saito @ 2008-09-30 13:32 UTC (permalink / raw)
To: Zoltan Boszormenyi <zb@cybertec.at>; +Cc: pgsql-odbc; Tom Lane <tgl@sss.pgh.pa.us>; Hans-Juergen Schoenig <hs@cybertec.at>
Hi Zoltan-san.
I appreciate much work. Please let me late review by the reason for not having margin
time now. sorry. However, we did those checks and adjustments in much environment.
They are VISTA-32bit, winXP-32bit, win2008-64bit,RedHat x86_64, FreeBSD-32bit,
Furthermore, VC6, VC8, Access2000,Access-XP,2005, Cygwin and etc required serious time....
Anyway, As for the Ver 08.03.0300, the result of those tests is reflected.
BTW, the description document point of nptl was unknown...
--
> 2) Fix for "implicit declaration of pthread_mutexattr_settype"
> on my Fedora 9 system.
--
Thanks.
Regards,
Hiroshi Saito
----- Original Message -----
From: "Zoltan Boszormenyi" <zb@cybertec.at>
> Hi,
>
> here are two patches that are applicable after my previous patch.
> 1) Cleanup to replace CSTR func = "..." with __FUNCTION__.
> There will be no more "'func' is defined but not used."
> This was done by sed scripts and verified manually
> so only the relevant places were substituted.
> 2) Fix for "implicit declaration of pthread_mutexattr_settype"
> on my Fedora 9 system.
>
> Adding "-Wno-pointer-sign" to AM_CFLAGS would
> prevent "pointer differ in signedness" warnings but
> it would cover an error in erroneous 8-bit arithmetics.
> Cleaning up the SQLCHAR vs. char problems is preferred.
>
> Best regards,
> Zoltán Böszörményi
>
> Zoltan Boszormenyi írta:
>> Zoltan Boszormenyi írta:
>>
>>> Hi,
>>>
>>> here's the fix for all non-pointer-signedness warnings,
>>> against 08.03.0300 that was released meanwhile. Now
>>> the compilation only emits 246 "differ in signedness"
>>> warnings, which is still too much noise. I agree with
>>> Tom Lane that those should be cleaned up if for nothing
>>> else, than the real bugs don't get lost in the noise.
>>>
>>> The patch cleans up such warnings in several files:
>>> "label 'cleanup' defined but not used" and
>>> "unused variable 'func'"
>>>
>>> In convert.c::convert_escape():
>>> "'param_consumed' may be used uninitialized in this function"
>>> The variable "param_consumed" was not assigned a value
>>> in all cases by processParameters() upon returning,
>>> so I tried to fix it there. Now it does, please review.
>>>
>>> In descriptor.c::TI_Constructor():
>>> "the address of 'qual' will always evaluate as 'true'"
>>> STRX_TO_NAME() has to be used instead of STR_TO_NAME.
>>>
>>> In drvconn.c::dconn_get_attributes():
>>> "'last' may be used uninitialized in this function"
>>> The first parameter to strtok_r() may be NULL if
>>> strdup() returns NULL. In that case strtok_r() may
>>> corrupt unknown memory areas.
>>>
>>> In pgapi30.c, two instances of
>>> "cast from pointer to integer of different size"
>>>
>>> In psqlodbc.c()::finalize_global_cs() is only used inside
>>> "#ifdef WIN32" but was defined outside causing a
>>> "defined but not used" warning.
>>>
>>> Some notes:
>>> - Instead of using 'CSTR func = "funcname";' everywhere,
>>> it would be better to use the __FUNCTION__ pre-processor
>>> macro. This way, the "unused variable 'func'" is eliminated
>>> once and for all as __FUNCTION__ is available everywhere.
>>> - The sea of "differ in signedness" warnings are caused by
>>> the difference of "{SQL|U}CHAR *" and plain "char *".
>>> Many ODBC API calls expect "SQLCHAR *" input.
>>> Using strcpy(), strcmp(), etc. on them causes warnings.
>>> Many internal psqlODBC functions expect a character input
>>> and they are also used inconsistenly with different
>>> signed and unsigned parameters.
>>> Either the API parameters has to be treated internally
>>> as "char *" and keep a local variable for this purpose,
>>> or pass the SQLCHAR * down in other functions which
>>> have to be declared with the appropriate header.
>>> Fixing it either way would be quite invasive in terms
>>> of patch size. The latter would mean smaller and
>>> cleaner C source.
>>>
>>> Best regards,
>>> Zoltán Böszörményi
>>>
>>> Hiroshi Saito írta:
>>>
>>>
>>>> Hi.
>>>>
>>>> Surely, we have not made offer sufficient about x86_64.... However,
>>>> The check of operation
>>>> was performed by the temporary rental machine. Moreover, there is also
>>>> a situation of taking
>>>> time in the check of the present BIGENDIAN. Then, late work may be
>>>> blamed....
>>>> Anyway, In order to avoid a problem, to be warning should clear.
>>>>
>>>> BTW, FreeBSD x86 is this.
>>>> inet% gmake socket.o
>>>> if gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include
>>>> -I/usr/local/pgsql/include -Wall -g -O2 -MT socket.o -MD -MP -MF
>>>> ".deps/socket.Tpo" -c -o socket.o socket.c; \
>>>> then mv -f ".deps/socket.Tpo" ".deps/socket.Po"; else rm -f
>>>> ".deps/socket.Tpo"; exit 1; fi
>>>> socket.c: In function `SOCK_wait_for_ready':
>>>> socket.c:468: warning: 'no_timeout' might be used uninitialized in
>>>> this function
>>>>
>>>> Regards,
>>>> Hiroshi Saito
>>>>
>>>> ----- Original Message ----- From: "Tom Lane" <tgl@sss.pgh.pa.us>
>>>>
>>>>
>>>>
>>>>
>>>>> I wrote:
>>>>>
>>>>>
>>>>>> BTW, isn't anyone paying attention to compiler warnings in this code
>>>>>> base?
>>>>>>
>>>>>>
>>>>> To be concrete, attached is a list of warnings I see when building .0200
>>>>> using gcc -Wall on an x86_64 Fedora 9 machine. If I were in charge of
>>>>> this project I'd insist on every one of these being cleaned up --- they
>>>>> are at least evidence of sloppy programming, and a significant fraction
>>>>> look like they mean certain crashes if the code ever gets executed.
>>>>>
>>>>> BTW, I've omitted 261 "pointer targets differ in signedness" warnings...
>>>>> those are probably not interesting, but I'd still recommend cleaning
>>>>> them up, if only so that more important warnings don't get lost in the
>>>>> noise. The core Postgres project has maintained a zero-tolerance policy
>>>>> on gcc warnings for years, and I think it's served us well.
>>>>>
>>>>> regards, tom lane
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>
>
> --
> ----------------------------------
> Zoltán Böszörményi
> Cybertec Schönig & Schönig GmbH
> http://www.postgresql.at/
>
>
--------------------------------------------------------------------------------
> diff -durpN psqlodbc-08.03.0300.new1/Makefile.am psqlodbc-08.03.0300.new2/Makefile.am
> --- psqlodbc-08.03.0300.new1/Makefile.am 2008-09-30 13:14:09.000000000 +0200
> +++ psqlodbc-08.03.0300.new2/Makefile.am 2008-09-30 13:36:31.000000000 +0200
> @@ -15,8 +15,8 @@ lib_LTLIBRARIES = psqlodbcw.la
> else
> lib_LTLIBRARIES = psqlodbca.la
> endif
> -
> -AM_CFLAGS = -Wall
> +
> +AM_CFLAGS = -Wall -D_BSD_SOURCE -D_XOPEN_SOURCE=500
>
> AM_LDFLAGS = -module -no-undefined -avoid-version
>
>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Compiler warnings in psqloodbc 08.03.0200
2008-09-16 13:12 Compiler warnings in psqloodbc 08.03.0200 Tom Lane <tgl@sss.pgh.pa.us>
2008-09-16 14:45 ` Re: Compiler warnings in psqloodbc 08.03.0200 Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
2008-09-29 10:03 ` Re: Compiler warnings in psqloodbc 08.03.0200 Zoltan Boszormenyi <zb@cybertec.at>
2008-09-29 10:05 ` Re: Compiler warnings in psqloodbc 08.03.0200 Zoltan Boszormenyi <zb@cybertec.at>
2008-09-30 13:32 ` Re: Compiler warnings in psqloodbc 08.03.0200 Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
@ 2008-09-30 16:56 ` Zoltan Boszormenyi <zb@cybertec.at>
0 siblings, 0 replies; 6+ messages in thread
From: Zoltan Boszormenyi @ 2008-09-30 16:56 UTC (permalink / raw)
To: Hiroshi Saito <z-saito@guitar.ocn.ne.jp>; +Cc: pgsql-odbc@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>; Hans-Juergen Schoenig <hs@cybertec.at>
Hi,
Hiroshi Saito írta:
> Hi Zoltan-san.
>
> I appreciate much work. Please let me late review by the reason for
> not having margin
> time now.
No problem, take your time.
I just wanted it to be out of my machine. :-)
> sorry. However, we did those checks and adjustments in much environment.
> They are VISTA-32bit, winXP-32bit, win2008-64bit,RedHat x86_64,
> FreeBSD-32bit,
> Furthermore, VC6, VC8, Access2000,Access-XP,2005, Cygwin and etc
> required serious time....
> Anyway, As for the Ver 08.03.0300, the result of those tests is
> reflected.
I understand your position. I just checked on Visual C++ 2005
and 2008 and they also understand __FUNCTION__ and it works
as expected, i.e. it presents the current function name just as on GCC.
The Microsoft OS doesn't matter, it's the compiler that matters.
I suspect things like __FUNCTION__ are actually defined in the
C language standard as a mandatory feature provided by the compiler
and *BSDs also conform.
However, on some systems (newer Linux systems with a recent
GCC 4.x) spit out "pointers differ in signedness" warnings if the
signedness of char variables/expressions differ in assignments or
passed-in vs declared function parameters. As Tom said, this can
create a situation where there are so many of them that other more
serious warnings are simply lost in the noise. A zero-warning policy
is indeed useful in C language projects.
> BTW, the description document point of nptl was unknown...
> --
The below is not about NPTL workings, it's about GLIBC in general
on Fedora 9 and most other GLIBC-using systems, like your
RedHat x86_64 above. In pthread.h, pthread_mutexattr_settype() and
others are protected inside
#ifdef __USE_UNIX98
...
#endif
So simply compiling it produces a "implicit declaration of //function '...'"
warning. __USE_UNIX98 gets defined in features.h if the symbol
_XOPEN_SOURCE is defined with a value >=500. features.h is
included by all other GLIBC headers directly or indirectly.
But defining _XOPEN_SOURCE seems to override the GCC
default (POSIX, XOPEN, etc) conformance level symbols and
now strcasecmp(), strncasecmp(), snprintf() and malloc() are
undefined now. To make them visible again, _BSD_SOURCE or
_GNU_SOURCE has to be defined. I chose _BSD_SOURCE
because it will not offend people using BSDs. :-)
>> 2) Fix for "implicit declaration of pthread_mutexattr_settype"
>> on my Fedora 9 system.
> --
Best regards,
Zoltán Böszörményi
> Thanks.
>
> Regards,
> Hiroshi Saito
>
> ----- Original Message ----- From: "Zoltan Boszormenyi" <zb@cybertec.at>
>
>
>> Hi,
>>
>> here are two patches that are applicable after my previous patch.
>> 1) Cleanup to replace CSTR func = "..." with __FUNCTION__.
>> There will be no more "'func' is defined but not used."
>> This was done by sed scripts and verified manually
>> so only the relevant places were substituted.
>> 2) Fix for "implicit declaration of pthread_mutexattr_settype"
>> on my Fedora 9 system.
>>
>> Adding "-Wno-pointer-sign" to AM_CFLAGS would
>> prevent "pointer differ in signedness" warnings but
>> it would cover an error in erroneous 8-bit arithmetics.
>> Cleaning up the SQLCHAR vs. char problems is preferred.
>>
>> Best regards,
>> Zoltán Böszörményi
>>
>> Zoltan Boszormenyi írta:
>>> Zoltan Boszormenyi írta:
>>>
>>>> Hi,
>>>>
>>>> here's the fix for all non-pointer-signedness warnings,
>>>> against 08.03.0300 that was released meanwhile. Now
>>>> the compilation only emits 246 "differ in signedness"
>>>> warnings, which is still too much noise. I agree with
>>>> Tom Lane that those should be cleaned up if for nothing
>>>> else, than the real bugs don't get lost in the noise.
>>>>
>>>> The patch cleans up such warnings in several files:
>>>> "label 'cleanup' defined but not used" and
>>>> "unused variable 'func'"
>>>>
>>>> In convert.c::convert_escape():
>>>> "'param_consumed' may be used uninitialized in this function"
>>>> The variable "param_consumed" was not assigned a value
>>>> in all cases by processParameters() upon returning,
>>>> so I tried to fix it there. Now it does, please review.
>>>>
>>>> In descriptor.c::TI_Constructor():
>>>> "the address of 'qual' will always evaluate as 'true'"
>>>> STRX_TO_NAME() has to be used instead of STR_TO_NAME.
>>>>
>>>> In drvconn.c::dconn_get_attributes():
>>>> "'last' may be used uninitialized in this function"
>>>> The first parameter to strtok_r() may be NULL if
>>>> strdup() returns NULL. In that case strtok_r() may
>>>> corrupt unknown memory areas.
>>>>
>>>> In pgapi30.c, two instances of
>>>> "cast from pointer to integer of different size"
>>>>
>>>> In psqlodbc.c()::finalize_global_cs() is only used inside
>>>> "#ifdef WIN32" but was defined outside causing a
>>>> "defined but not used" warning.
>>>>
>>>> Some notes:
>>>> - Instead of using 'CSTR func = "funcname";' everywhere,
>>>> it would be better to use the __FUNCTION__ pre-processor
>>>> macro. This way, the "unused variable 'func'" is eliminated
>>>> once and for all as __FUNCTION__ is available everywhere.
>>>> - The sea of "differ in signedness" warnings are caused by
>>>> the difference of "{SQL|U}CHAR *" and plain "char *".
>>>> Many ODBC API calls expect "SQLCHAR *" input.
>>>> Using strcpy(), strcmp(), etc. on them causes warnings.
>>>> Many internal psqlODBC functions expect a character input
>>>> and they are also used inconsistenly with different
>>>> signed and unsigned parameters.
>>>> Either the API parameters has to be treated internally
>>>> as "char *" and keep a local variable for this purpose,
>>>> or pass the SQLCHAR * down in other functions which
>>>> have to be declared with the appropriate header.
>>>> Fixing it either way would be quite invasive in terms
>>>> of patch size. The latter would mean smaller and
>>>> cleaner C source.
>>>>
>>>> Best regards,
>>>> Zoltán Böszörményi
>>>>
>>>> Hiroshi Saito írta:
>>>>
>>>>
>>>>> Hi.
>>>>>
>>>>> Surely, we have not made offer sufficient about x86_64.... However,
>>>>> The check of operation
>>>>> was performed by the temporary rental machine. Moreover, there is
>>>>> also
>>>>> a situation of taking
>>>>> time in the check of the present BIGENDIAN. Then, late work may be
>>>>> blamed....
>>>>> Anyway, In order to avoid a problem, to be warning should clear.
>>>>>
>>>>> BTW, FreeBSD x86 is this.
>>>>> inet% gmake socket.o
>>>>> if gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include
>>>>> -I/usr/local/pgsql/include -Wall -g -O2 -MT socket.o -MD -MP -MF
>>>>> ".deps/socket.Tpo" -c -o socket.o socket.c; \
>>>>> then mv -f ".deps/socket.Tpo" ".deps/socket.Po"; else rm -f
>>>>> ".deps/socket.Tpo"; exit 1; fi
>>>>> socket.c: In function `SOCK_wait_for_ready':
>>>>> socket.c:468: warning: 'no_timeout' might be used uninitialized in
>>>>> this function
>>>>>
>>>>> Regards,
>>>>> Hiroshi Saito
>>>>>
>>>>> ----- Original Message ----- From: "Tom Lane" <tgl@sss.pgh.pa.us>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> I wrote:
>>>>>>
>>>>>>
>>>>>>> BTW, isn't anyone paying attention to compiler warnings in this
>>>>>>> code
>>>>>>> base?
>>>>>>>
>>>>>>>
>>>>>> To be concrete, attached is a list of warnings I see when
>>>>>> building .0200
>>>>>> using gcc -Wall on an x86_64 Fedora 9 machine. If I were in
>>>>>> charge of
>>>>>> this project I'd insist on every one of these being cleaned up
>>>>>> --- they
>>>>>> are at least evidence of sloppy programming, and a significant
>>>>>> fraction
>>>>>> look like they mean certain crashes if the code ever gets executed.
>>>>>>
>>>>>> BTW, I've omitted 261 "pointer targets differ in signedness"
>>>>>> warnings...
>>>>>> those are probably not interesting, but I'd still recommend cleaning
>>>>>> them up, if only so that more important warnings don't get lost
>>>>>> in the
>>>>>> noise. The core Postgres project has maintained a zero-tolerance
>>>>>> policy
>>>>>> on gcc warnings for years, and I think it's served us well.
>>>>>>
>>>>>> regards, tom lane
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>>
>>
>>
>> --
>> ----------------------------------
>> Zoltán Böszörményi
>> Cybertec Schönig & Schönig GmbH
>> http://www.postgresql.at/
>>
>>
>
>
> --------------------------------------------------------------------------------
>
>
>
>> diff -durpN psqlodbc-08.03.0300.new1/Makefile.am
>> psqlodbc-08.03.0300.new2/Makefile.am
>> --- psqlodbc-08.03.0300.new1/Makefile.am 2008-09-30
>> 13:14:09.000000000 +0200
>> +++ psqlodbc-08.03.0300.new2/Makefile.am 2008-09-30
>> 13:36:31.000000000 +0200
>> @@ -15,8 +15,8 @@ lib_LTLIBRARIES = psqlodbcw.la
>> else
>> lib_LTLIBRARIES = psqlodbca.la
>> endif
>> -
>> -AM_CFLAGS = -Wall
>> +
>> +AM_CFLAGS = -Wall -D_BSD_SOURCE -D_XOPEN_SOURCE=500
>>
>> AM_LDFLAGS = -module -no-undefined -avoid-version
>>
>>
>
>
--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2008-09-30 16:56 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-09-16 13:12 Compiler warnings in psqloodbc 08.03.0200 Tom Lane <tgl@sss.pgh.pa.us>
2008-09-16 14:45 ` Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
2008-09-29 10:03 ` Zoltan Boszormenyi <zb@cybertec.at>
2008-09-29 10:05 ` Zoltan Boszormenyi <zb@cybertec.at>
2008-09-30 13:32 ` Hiroshi Saito <z-saito@guitar.ocn.ne.jp>
2008-09-30 16:56 ` Zoltan Boszormenyi <zb@cybertec.at>
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