[perl5-dbi/dbi] bc7801: Fix compile warnings in Driver.xst
Branch: refs/heads/master Home: https://github.com/perl5-dbi/dbi Commit: bc78012cf6a70228d7d3dd0814cbde29be62bf47 https://github.com/perl5-dbi/dbi/commit/bc78012cf6a70228d7d3dd0814cbde29be62bf47 Author: Pali <p...@cpan.org> Date: 2018-02-09 (Fri, 09 Feb 2018) Changed paths: M Driver.xst M Perl.xs Log Message: --- Fix compile warnings in Driver.xst Perl.c: In function ‘XS_DBD__Perl__dr_data_sources’: Perl.c:276:7: warning: variable ‘attr’ set but not used [-Wunused-but-set-variable] SV * attr; ^~~~ Perl.c: In function ‘XS_DBD__Perl__db__login’: Perl.c:320:7: warning: variable ‘attribs’ set but not used [-Wunused-but-set-variable] SV * attribs; ^~~ Perl.c: In function ‘XS_DBD__Perl__db_last_insert_id’: Perl.c:604:7: warning: variable ‘attr’ set but not used [-Wunused-but-set-variable] SV * attr; ^~~~ Commit: f3f723acc7f657b7a091bd1d96acacaf9eb916ee https://github.com/perl5-dbi/dbi/commit/f3f723acc7f657b7a091bd1d96acacaf9eb916ee Author: Tim Bunce <tim.bu...@pobox.com> Date: 2018-03-19 (Mon, 19 Mar 2018) Changed paths: M Driver.xst M Perl.xs Log Message: --- Merge pull request #59 from pali/master Fix compile warnings in Driver.xst Compare: https://github.com/perl5-dbi/dbi/compare/3accfb15cb46...f3f723acc7f6
warnings since last DBI release
In file included from ODBC.c:70: /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h: In function ‘dbdxst_bind_params’: /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h:72: warning: passing argument 2 of ‘imp_sth-com.std.dbistate-set_err_char’ from incompatible pointer type /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h:72: note: expected ‘struct imp_xxh_t *’ but argument is of type ‘struct imp_sth_t *’ /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h: In function ‘dbdxst_fetchall_arrayref’: /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h:98: warning: passing argument 2 of ‘imp_sth-com.std.dbistate-set_err_char’ from incompatible pointer type /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h:98: note: expected ‘struct imp_xxh_t *’ but argument is of type ‘struct imp_sth_t *’ cc -c -I/usr/include -I. -I/usr/local/lib/perl/5.10.1/auto/DBI -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\1.34_3\ -DXS_VERSION=\1.34_3\ -fPIC -I/usr/lib/perl/5.10/CORE -I/usr/include dbdimp.c It is 2 added calls to DBIh_SET_ERR_CHAR in Driver_xst.h. Martin -- Martin J. Evans Easysoft Limited http://www.easysoft.com
Re: warnings since last DBI release
On Fri, 03 Feb 2012 10:04:28 +, Martin J. Evans martin.ev...@easysoft.com wrote: In file included from ODBC.c:70: /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h: In function ‘dbdxst_bind_params’: /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h:72: warning: passing argument 2 of ‘imp_sth-com.std.dbistate-set_err_char’ from incompatible pointer type /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h:72: note: expected ‘struct imp_xxh_t *’ but argument is of type ‘struct imp_sth_t *’ /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h: In function ‘dbdxst_fetchall_arrayref’: /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h:98: warning: passing argument 2 of ‘imp_sth-com.std.dbistate-set_err_char’ from incompatible pointer type /usr/local/lib/perl/5.10.1/auto/DBI/Driver_xst.h:98: note: expected ‘struct imp_xxh_t *’ but argument is of type ‘struct imp_sth_t *’ cc -c -I/usr/include -I. -I/usr/local/lib/perl/5.10.1/auto/DBI -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\1.34_3\ -DXS_VERSION=\1.34_3\ -fPIC -I/usr/lib/perl/5.10/CORE -I/usr/include dbdimp.c It is 2 added calls to DBIh_SET_ERR_CHAR in Driver_xst.h. Warnings (on HP-UX 11.31/5.14.2-64all-ld) *in* last release: DBI.xs, line 1469: warning #4232-D: conversion from XPVHV * to a more strictly aligned type XPVMG * may cause misaligned access PerlIO_printf(DBILOGFP,%s CachedKids %d\n, pad, (int)HvKEYS(hv)); ^ DBI.xs, line 2582: warning #4232-D: conversion from XPVHV * to a more strictly aligned type XPVMG * may cause misaligned access if (HvKEYS(hv)) { ^ DBI.xs, line 2587: warning #4232-D: conversion from XPVHV * to a more strictly aligned type XPVMG * may cause misaligned access meth_name, neatsvpv(h,0), (int)HvKEYS(hv)); ^ DBI.xs, line 4486: warning #2181-D: argument is incompatible with corresponding format string conversion NULL, ^ All tests pass though 1465if (DBIc_TYPE(imp_xxh) = DBIt_DB) { 1466SV **svp = hv_fetch((HV*)SvRV(inner), CachedKids, 10, 0); 1467if (svp SvROK(*svp) SvTYPE(SvRV(*svp)) == SVt_PVHV) { 1468HV *hv = (HV*)SvRV(*svp); 1469PerlIO_printf(DBILOGFP,%s CachedKids %d\n, pad, (int)HvKEYS(hv)); 1470} 1471} 2576clear_cached_kids(pTHX_ SV *h, imp_xxh_t *imp_xxh, const char *meth_name, int trace_level) 2577{ 2578if (DBIc_TYPE(imp_xxh) = DBIt_DB) { 2579SV **svp = hv_fetch((HV*)SvRV(h), CachedKids, 10, 0); 2580if (svp SvROK(*svp) SvTYPE(SvRV(*svp)) == SVt_PVHV) { 2581HV *hv = (HV*)SvRV(*svp); 2582if (HvKEYS(hv)) { 2583if (DBIc_TRACE_LEVEL(imp_xxh) trace_level) 2584trace_level = DBIc_TRACE_LEVEL(imp_xxh); 2585if (trace_level = 2) { 2586PerlIO_printf(DBIc_LOGPIO(imp_xxh), %s %s clearing %d CachedKids\n, 2587meth_name, neatsvpv(h,0), (int)HvKEYS(hv)); 2588PerlIO_flush(DBIc_LOGPIO(imp_xxh)); 2589} 2590/* This will probably recurse through dispatch to DESTROY the kids */ 2591/* For drh we should probably explicitly do dbh disconnects */ 2592hv_clear(hv); 2593} 2594} 2595} 2596} 4476if (level != RETVAL) { 4477if ((level DBIc_TRACE_LEVEL_MASK) 0) { 4478PerlIO_printf(DBILOGFP,DBI %s%s default trace level set to 0x%lx/%ld (pid %d pi %p) at %s\n, 4479XS_VERSION, dbi_build_opt, 4480(long)(level DBIc_TRACE_FLAGS_MASK), 4481(long)(level DBIc_TRACE_LEVEL_MASK), 4482(int)PerlProc_getpid(), 4483#ifdef MULTIPLICITY 4484(void *)my_perl, 4485#else 4486NULL, 4487#endif 4488log_where(Nullsv, 0, , , 1, 1, 0) 4489); 4490if (!PL_dowarn) 4491PerlIO_printf(DBILOGFP,Note: perl is running without the recommended perl -w option\n); 4492PerlIO_flush(DBILOGFP); 4493} -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.14 porting perl5 on HP-UX, AIX, and openSUSE http://mirrors.develooper.com/hpux/http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Re: warnings since last DBI release
On Fri, 03 Feb 2012 15:42:40 +, Martin J. Evans martin.ev...@easysoft.com wrote: On 03/02/12 15:16, Tim Bunce wrote: On Fri, Feb 03, 2012 at 11:22:19AM +0100, H.Merijn Brand wrote: Warnings (on HP-UX 11.31/5.14.2-64all-ld) *in* last release: DBI.xs, line 1469: warning #4232-D: conversion from XPVHV * to a more strictly aligned type XPVMG * may cause misaligned access DBI.xs, line 2582: warning #4232-D: conversion from XPVHV * to a more strictly aligned type XPVMG * may cause misaligned access DBI.xs, line 2587: warning #4232-D: conversion from XPVHV * to a more strictly aligned type XPVMG * may cause misaligned access Not sure what to do about those. They are not DBI ones, they are the Perl macro HvKEYS - on HPUX. Might want mentioning on p5p - I think Merijn was thinking about doing that. I did. No reply yet. DBI.xs, line 4486: warning #2181-D: argument is incompatible with corresponding format string conversion NULL, Does adding a (void*) in front silence that one? Merijn discovered it does and it appears something redefines NULL as 0L somewhere. And yes, (void *)NULL removes the warning. Note that this is a 64bitall build. I had no time to trace the exact location of the define to 0L, but it might be related. -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.14 porting perl5 on HP-UX, AIX, and openSUSE http://mirrors.develooper.com/hpux/http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Warnings
Hey All, Just installed 1.614 on three of my boxes. Looks good, and thanks for getting it out! I did notice some warnings, though: /usr/local/bin/perl /usr/local/lib/perl5/5.12.2/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.12.2/ExtUtils/typemap -typemap typemap DBI.xs DBI.xsc mv DBI.xsc DBI.c cc -c -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O3 -DVERSION=\1.614\ -DXS_VERSION=\1.614\ -I/usr/local/lib/perl5/5.12.2/darwin-thread-multi-2level/CORE -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter DBI.c DBI.xs: In function ‘dbih_setup_handle’: DBI.xs:1280: warning: value computed is not used DBI.xs:1318: warning: value computed is not used DBI.xs:1319: warning: value computed is not used DBI.xs:1324: warning: value computed is not used DBI.xs:1327: warning: value computed is not used DBI.xs: In function ‘dbih_set_attr_k’: DBI.xs:2062: warning: value computed is not used DBI.xs: In function ‘dbih_get_attr_k’: DBI.xs:2157: warning: value computed is not used DBI.xs:2384: warning: value computed is not used DBI.xs: In function ‘_profile_next_node’: DBI.xs:2590: warning: value computed is not used DBI.xs: In function ‘XS_DBI_dispatch’: DBI.xs:3143: warning: value computed is not used DBI.xs:3222: warning: value computed is not used DBI.xs: In function ‘XS_DBI__new_handle’: DBI.xs:4243: warning: value computed is not used DBI.xs: In function ‘XS_DBD_st_fetchrow_hashref’: DBI.xs:4965: warning: value computed is not used New DBIx::Connector now on its way to CPAN, too. Thanks, David
Re: Warnings
On 17/09/2010 19:51, David E. Wheeler wrote: Hey All, Just installed 1.614 on three of my boxes. Looks good, and thanks for getting it out! I did notice some warnings, though: /usr/local/bin/perl /usr/local/lib/perl5/5.12.2/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.12.2/ExtUtils/typemap -typemap typemap DBI.xs DBI.xsc mv DBI.xsc DBI.c cc -c -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O3 -DVERSION=\1.614\ -DXS_VERSION=\1.614\ -I/usr/local/lib/perl5/5.12.2/darwin-thread-multi-2level/CORE -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter DBI.c DBI.xs: In function ‘dbih_setup_handle’: DBI.xs:1280: warning: value computed is not used DBI.xs:1318: warning: value computed is not used DBI.xs:1319: warning: value computed is not used DBI.xs:1324: warning: value computed is not used DBI.xs:1327: warning: value computed is not used DBI.xs: In function ‘dbih_set_attr_k’: DBI.xs:2062: warning: value computed is not used DBI.xs: In function ‘dbih_get_attr_k’: DBI.xs:2157: warning: value computed is not used DBI.xs:2384: warning: value computed is not used DBI.xs: In function ‘_profile_next_node’: DBI.xs:2590: warning: value computed is not used DBI.xs: In function ‘XS_DBI_dispatch’: DBI.xs:3143: warning: value computed is not used DBI.xs:3222: warning: value computed is not used DBI.xs: In function ‘XS_DBI__new_handle’: DBI.xs:4243: warning: value computed is not used DBI.xs: In function ‘XS_DBD_st_fetchrow_hashref’: DBI.xs:4965: warning: value computed is not used New DBIx::Connector now on its way to CPAN, too. Thanks, David They are all hv_store calls and hv_store returns a value. I think they are all harmless and the only way to make them go away is to prefix each hv_store call with (void). I'm happy to sort that out unless anyone objects. Martin
Re: Warnings
On Fri, Sep 17, 2010 at 09:13:20PM +0100, Martin J. Evans wrote: DBI.xs:4965: warning: value computed is not used New DBIx::Connector now on its way to CPAN, too. Thanks. They are all hv_store calls and hv_store returns a value. I think they are all harmless and the only way to make them go away is to prefix each hv_store call with (void). I'm happy to sort that out unless anyone objects. I'd be delighted. Thanks Martin! Tim.
Re: DBD::Pg emits some warnings despite PrintError = 0
Lyle wrote: Hi, So far I've seen: NOTICE: CREATE TABLE / UNIQUE will create implicit index FOO_BAR for table FOO Lyle Did you look at PrintWarn. Martin -- Martin J. Evans Easysoft Limited http://www.easysoft.com
Re: DBD::Pg emits some warnings despite PrintError = 0
On 22/07/2010 07:40, Martin J. Evans wrote: Lyle wrote: Hi, So far I've seen: NOTICE: CREATE TABLE / UNIQUE will create implicit index FOO_BAR for table FOO Lyle Did you look at PrintWarn. Opps sorry, serves me right for sending email right before I go to sleep :/ Lyle
DBD::Pg emits some warnings despite PrintError = 0
Hi, So far I've seen: NOTICE: CREATE TABLE / UNIQUE will create implicit index FOO_BAR for table FOO Lyle
Re: DBD::DB2: handling warnings
On Tue, Dec 30, 2008 at 12:37:05PM -0500, Hildo Biersma wrote: The DBD::DB2 driver does not handle warnings in a manner consistent with other DBD drivers. Specifically, if the trace level is lower than 3, warnings are ignored; if the trace level is 3 or above, warnings are treated like errors. The driver also directly manipulates the DBI internals instead of using DBIh_SET_ERR_CHAR. It treats all SQL_SUCCESS_WITH_INFO cases as warnings - perhaps these should be reported as informational events instead. Yes, it should. (Just use instead of 0.) The DBI defaults PrintWarn to true, so if SQL_SUCCESS_WITH_INFO is treated as a warning then they'll get printed - probably not what most people would want. Tim.
DBD::DB2: handling warnings
The DBD::DB2 driver does not handle warnings in a manner consistent with other DBD drivers. Specifically, if the trace level is lower than 3, warnings are ignored; if the trace level is 3 or above, warnings are treated like errors. The driver also directly manipulates the DBI internals instead of using DBIh_SET_ERR_CHAR. I have asked IBM to fix this and have received an internal defect number for this (166025); however, the latest DBD::DB2 release (1.3) does not include this feature. The attached patch shows an attempt to fix this. It works for me, but I'm not sure it is entirely correct; feedback from DBD::xxx authors and DBI experts would be welcome. The patch basically removes the dependency on the trace level and rips out the direct manipulation of DBIc_err, errstr and state. It treats all SQL_SUCCESS_WITH_INFO cases as warnings - perhaps these should be reported as informational events instead. I hope IBM gets around to including this (or an improved version) in the next DBD::DB2 release; in the meantime, other users of DBD::DB2 may benefit from this change. Cheers, Hildo Biersma *** dbdimp.c.orig Tue Dec 30 10:03:29 2008 --- dbdimp.cTue Dec 30 12:28:15 2008 *** *** 54,63 SQLINTEGER sqlcode; SQLCHAR sqlstate[6]; SQLCHAR msgBuffer[SQL_MAX_MESSAGE_LENGTH+1]; ! char *msg = NULL; SQLRETURN rec; - if( SQL_SUCCESS == rc ) return rc; --- 54,62 SQLINTEGER sqlcode; SQLCHAR sqlstate[6]; SQLCHAR msgBuffer[SQL_MAX_MESSAGE_LENGTH+1]; ! char *msg = NULL, *err = NULL; SQLRETURN rec; if( SQL_SUCCESS == rc ) return rc; *** *** 80,88 } } - if( SQL_SUCCESS_WITH_INFO == rc DBIS-debug 3 ) - return SQL_SUCCESS; - if( handle != SQL_NULL_HANDLE ) { SQLRETURN rc; --- 79,84 *** *** 112,125 msg = what ? what : ; } ! sv_setiv(DBIc_ERR(imp_xxh), (IV)sqlcode); ! sv_setpv(errstr, (char *)msg); ! sv_setpv(state,(char *)sqlstate); ! DBIh_EVENT2(h, ERROR_event, DBIc_ERR(imp_xxh), errstr); ! if (DBIS-debug = 2) ! PerlIO_printf( DBILOGFP, ! %s error %d recorded: %s\n, ! what, rc, SvPV(errstr,na) ); return( rc == SQL_SUCCESS_WITH_INFO ? SQL_SUCCESS : rc ); } --- 108,120 msg = what ? what : ; } ! /* Report error or warning the DBI way */ ! if (rc == SQL_SUCCESS_WITH_INFO) { ! err = 0; /* 0 = warning */ ! } else { ! err = Nullch; ! } ! DBIh_SET_ERR_CHAR(h, imp_xxh, err, sqlcode, msg, sqlstate, Nullch); return( rc == SQL_SUCCESS_WITH_INFO ? SQL_SUCCESS : rc ); } *** *** 141,149 return rc; } - if( SQL_SUCCESS_WITH_INFO == rc DBIS-debug 3 ) - return SQL_SUCCESS; - if( SQL_ERROR == rc || SQL_SUCCESS_WITH_INFO == rc ) { imp_sth_t *imp_sth;
Re: Warnings during compilation of dbd-mysql on Mac OS X (for Fink distro)
Christian, I'm still working on this. Many lines there are. I need to also find out about some unused variables, if they still have to be passed according to DBI spec. For instance: dbdimp.c: In function 'mysql_db_FETCH_attrib dbdimp.c:2160: warning: unused parameter 'dbh' The code: SV* dbd_db_FETCH_attrib(dbh, imp_dbh_t* imp_dbh, SV* keysv) { ... Indeed, dbh is never used. not sure if I have to adhere to passing a dbh handle as first arg or can do some sort of __unused__ in the code to stifle these warnings. I just don't want to rip too much out, so I'm methodically going through one at a time. regards, Patrick Patrick Galbraith wrote: Christian Schaffner wrote: Hi Patrick On 27.10.2007, at 20:59, Patrick Galbraith wrote: Hi Christian, Yes, for now you can ignore them, but I will look at those. Strangely, I don't get those on my mac, but it's time for a release, and I am finally becoming un-buried to do so. If I try a - pedantic compile, maybe I can have them show up. Any news on that issue? (I agree, it might be only cosmetical, but some users got worried...) Today is the day I'm investigating this Mac issue. I'll let you know. I'm cc-ing the list to let people know I'm still here, and if anyone has patches they would like to include, please do send them. I have two other issues: 1) You seem to leave a /tmp/trace.log file lying around after the tests. This causes issues if the tests are run again under another user name. Thanks for reminding me! 2) Could you include a COPYING file in the dist that documents the license of the DBD::Mysql package? That would help packagers like me... Yes, I'll add that with appropriate license. Thanks for the reminders! Patrick Anyhow, thanks a lot for your efforts! Christian. Christian Schaffner wrote: Hi Patrick I am the maintainer of the Fink packages for dbd-mysql on Mac OS X: http://pdb.finkproject.org/pdb/package.php/dbd-mysql-pm586 I am trying to update the packages to version 4.005. But I get a lot of warnings during the compilation (see output below). Are these harmless? Can I ignore them? Am I doing something wrong? Thanks a lot for your help! Christian. PS: Build output (see end for perl and Mac OS X version infos): #!/bin/sh -ev # Need full path to perl ABSPERL=`which perl5.8.6` which perl5.8.6 perl5.8.6 Makefile.PL --nocatchstderr PERL=perl5.8.6 PREFIX=/sw INSTALLPRIVLIB=/sw/lib/perl5/5.8.6 INSTALLARCHLIB=/sw/lib/ perl5/5.8.6/ darwin-thread-multi-2level INSTALLSITELIB=/sw/lib/ perl5/5.8.6 INSTALLSITEARCH=/sw/lib/perl5/5.8.6/darwin-thread- multi-2level INSTALLMAN1DIR=/sw/share/man/man1 INSTALLMAN3DIR=/sw/ share/man/man3 INSTALLSITEMAN1DIR=/sw/share/man/man1 INSTALLSITEMAN3DIR=/sw/share/ man/man3 INSTALLBIN=/sw/bin INSTALLSITEBIN=/sw/bin INSTALLSCRIPT=/sw/bin I will use the following settings for compiling and testing: cflags(mysql_config ) = -I/sw/include/mysql -Wreturn- type - Wtrigraphs -W -Wformat -Wsign-compare -Wunused -fno-omit- frame- pointer -g embedded (mysql_config ) = libs (mysql_config ) = -L/sw/lib -L/sw/lib/mysql - lmysqlclient -lz -lm mysql_config (guessed ) = mysql_config nocatchstderr (User's choice) = 1 nofoundrows (default ) = 0 ssl (guessed ) = 0 testdb(default ) = test testhost (default ) = testpassword (default ) = testsocket(default ) = testuser (default ) = To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'. Checking if your kit is complete... Looks good Using DBI 1.59 (for perl 5.008006 on darwin-thread-multi-2level) installed in /sw/lib/perl5/5.8.6/darwin-thread-multi-2level/auto/DBI/ Writing Makefile for DBD::mysql make ABSPERL=$ABSPERL cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm cc -c -I/sw/lib/perl5/5.8.6/darwin-thread-multi-2level/auto/DBI - I/ sw/include/mysql -Wreturn-type -Wtrigraphs -W -Wformat -Wsign- compare -Wunused -fno-omit-frame-pointer -g - DDBD_MYSQL_INSERT_ID_IS_GOOD - g -g -pipe -fno-common - DPERL_DARWIN -no-cpp-precomp -fno-strict- aliasing -I/usr/local/ include -Os -DVERSION=\4.005\ -DXS_VERSION= \4.005\ -I/ System/Library/Perl/5.8.6/darwin-thread-multi-2level/ CORE dbdimp.c dbdimp.c: In function 'alloc_param': dbdimp.c:110: warning: comparison between signed and unsigned dbdimp.c: In function 'alloc_bind': dbdimp.c:128: warning: comparison between signed and unsigned dbdimp.c: In function 'alloc_fbind': dbdimp.c:144: warning: comparison between signed and unsigned dbdimp.c: In function 'alloc_fbuffer': dbdimp.c:159: warning: comparison between signed and unsigned dbdimp.c: In function 'parse_params': dbdimp.c:473: warning: comparison between signed
Re: Warnings during compilation of dbd-mysql on Mac OS X (for Fink distro)
Christian Schaffner wrote: Hi Patrick On 27.10.2007, at 20:59, Patrick Galbraith wrote: Hi Christian, Yes, for now you can ignore them, but I will look at those. Strangely, I don't get those on my mac, but it's time for a release, and I am finally becoming un-buried to do so. If I try a - pedantic compile, maybe I can have them show up. Any news on that issue? (I agree, it might be only cosmetical, but some users got worried...) Today is the day I'm investigating this Mac issue. I'll let you know. I'm cc-ing the list to let people know I'm still here, and if anyone has patches they would like to include, please do send them. I have two other issues: 1) You seem to leave a /tmp/trace.log file lying around after the tests. This causes issues if the tests are run again under another user name. Thanks for reminding me! 2) Could you include a COPYING file in the dist that documents the license of the DBD::Mysql package? That would help packagers like me... Yes, I'll add that with appropriate license. Thanks for the reminders! Patrick Anyhow, thanks a lot for your efforts! Christian. Christian Schaffner wrote: Hi Patrick I am the maintainer of the Fink packages for dbd-mysql on Mac OS X: http://pdb.finkproject.org/pdb/package.php/dbd-mysql-pm586 I am trying to update the packages to version 4.005. But I get a lot of warnings during the compilation (see output below). Are these harmless? Can I ignore them? Am I doing something wrong? Thanks a lot for your help! Christian. PS: Build output (see end for perl and Mac OS X version infos): #!/bin/sh -ev # Need full path to perl ABSPERL=`which perl5.8.6` which perl5.8.6 perl5.8.6 Makefile.PL --nocatchstderr PERL=perl5.8.6 PREFIX=/sw INSTALLPRIVLIB=/sw/lib/perl5/5.8.6 INSTALLARCHLIB=/sw/lib/ perl5/5.8.6/ darwin-thread-multi-2level INSTALLSITELIB=/sw/lib/ perl5/5.8.6 INSTALLSITEARCH=/sw/lib/perl5/5.8.6/darwin-thread- multi-2level INSTALLMAN1DIR=/sw/share/man/man1 INSTALLMAN3DIR=/sw/ share/man/man3 INSTALLSITEMAN1DIR=/sw/share/man/man1 INSTALLSITEMAN3DIR=/sw/share/ man/man3 INSTALLBIN=/sw/bin INSTALLSITEBIN=/sw/bin INSTALLSCRIPT=/sw/bin I will use the following settings for compiling and testing: cflags(mysql_config ) = -I/sw/include/mysql -Wreturn- type - Wtrigraphs -W -Wformat -Wsign-compare -Wunused -fno-omit- frame- pointer -g embedded (mysql_config ) = libs (mysql_config ) = -L/sw/lib -L/sw/lib/mysql - lmysqlclient -lz -lm mysql_config (guessed ) = mysql_config nocatchstderr (User's choice) = 1 nofoundrows (default ) = 0 ssl (guessed ) = 0 testdb(default ) = test testhost (default ) = testpassword (default ) = testsocket(default ) = testuser (default ) = To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'. Checking if your kit is complete... Looks good Using DBI 1.59 (for perl 5.008006 on darwin-thread-multi-2level) installed in /sw/lib/perl5/5.8.6/darwin-thread-multi-2level/auto/DBI/ Writing Makefile for DBD::mysql make ABSPERL=$ABSPERL cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm cc -c -I/sw/lib/perl5/5.8.6/darwin-thread-multi-2level/auto/DBI - I/ sw/include/mysql -Wreturn-type -Wtrigraphs -W -Wformat -Wsign- compare -Wunused -fno-omit-frame-pointer -g - DDBD_MYSQL_INSERT_ID_IS_GOOD - g -g -pipe -fno-common - DPERL_DARWIN -no-cpp-precomp -fno-strict- aliasing -I/usr/local/ include -Os -DVERSION=\4.005\ -DXS_VERSION= \4.005\ -I/ System/Library/Perl/5.8.6/darwin-thread-multi-2level/ COREdbdimp.c dbdimp.c: In function 'alloc_param': dbdimp.c:110: warning: comparison between signed and unsigned dbdimp.c: In function 'alloc_bind': dbdimp.c:128: warning: comparison between signed and unsigned dbdimp.c: In function 'alloc_fbind': dbdimp.c:144: warning: comparison between signed and unsigned dbdimp.c: In function 'alloc_fbuffer': dbdimp.c:159: warning: comparison between signed and unsigned dbdimp.c: In function 'parse_params': dbdimp.c:473: warning: comparison between signed and unsigned dbdimp.c: In function 'dbd_discon_all': dbdimp.c:1941: warning: unused variable 'imp_xxh' dbdimp.c: In function 'mysql_db_FETCH_attrib': dbdimp.c:2160: warning: unused parameter 'dbh' dbdimp.c: In function 'mysql_st_internal_execute': dbdimp.c:2788: warning: unused parameter 'attribs' dbdimp.c: In function 'mysql_st_FETCH_attrib': dbdimp.c:4035: warning: comparison between signed and unsigned dbdimp.c: In function 'mysql_st_blob_read': dbdimp.c:4144: warning: unused parameter 'sth' dbdimp.c:4145: warning: unused parameter 'imp_sth' dbdimp.c:4146: warning: unused parameter 'field' dbdimp.c:4147: warning: unused parameter 'offset' dbdimp.c:4148: warning
Re: Warnings during compilation of dbd-mysql on Mac OS X (for Fink distro)
Hi Patrick On 27.10.2007, at 20:59, Patrick Galbraith wrote: Hi Christian, Yes, for now you can ignore them, but I will look at those. Strangely, I don't get those on my mac, but it's time for a release, and I am finally becoming un-buried to do so. If I try a - pedantic compile, maybe I can have them show up. Any news on that issue? (I agree, it might be only cosmetical, but some users got worried...) I'm cc-ing the list to let people know I'm still here, and if anyone has patches they would like to include, please do send them. I have two other issues: 1) You seem to leave a /tmp/trace.log file lying around after the tests. This causes issues if the tests are run again under another user name. 2) Could you include a COPYING file in the dist that documents the license of the DBD::Mysql package? That would help packagers like me... Anyhow, thanks a lot for your efforts! Christian. Christian Schaffner wrote: Hi Patrick I am the maintainer of the Fink packages for dbd-mysql on Mac OS X: http://pdb.finkproject.org/pdb/package.php/dbd-mysql-pm586 I am trying to update the packages to version 4.005. But I get a lot of warnings during the compilation (see output below). Are these harmless? Can I ignore them? Am I doing something wrong? Thanks a lot for your help! Christian. PS: Build output (see end for perl and Mac OS X version infos): #!/bin/sh -ev # Need full path to perl ABSPERL=`which perl5.8.6` which perl5.8.6 perl5.8.6 Makefile.PL --nocatchstderr PERL=perl5.8.6 PREFIX=/sw INSTALLPRIVLIB=/sw/lib/perl5/5.8.6 INSTALLARCHLIB=/sw/lib/ perl5/5.8.6/ darwin-thread-multi-2level INSTALLSITELIB=/sw/lib/ perl5/5.8.6 INSTALLSITEARCH=/sw/lib/perl5/5.8.6/darwin-thread- multi-2level INSTALLMAN1DIR=/sw/share/man/man1 INSTALLMAN3DIR=/sw/ share/man/man3 INSTALLSITEMAN1DIR=/sw/share/man/man1 INSTALLSITEMAN3DIR=/sw/share/ man/man3 INSTALLBIN=/sw/bin INSTALLSITEBIN=/sw/bin INSTALLSCRIPT=/sw/bin I will use the following settings for compiling and testing: cflags(mysql_config ) = -I/sw/include/mysql -Wreturn- type - Wtrigraphs -W -Wformat -Wsign-compare -Wunused -fno-omit- frame- pointer -g embedded (mysql_config ) = libs (mysql_config ) = -L/sw/lib -L/sw/lib/mysql - lmysqlclient -lz -lm mysql_config (guessed ) = mysql_config nocatchstderr (User's choice) = 1 nofoundrows (default ) = 0 ssl (guessed ) = 0 testdb(default ) = test testhost (default ) = testpassword (default ) = testsocket(default ) = testuser (default ) = To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'. Checking if your kit is complete... Looks good Using DBI 1.59 (for perl 5.008006 on darwin-thread-multi-2level) installed in /sw/lib/perl5/5.8.6/darwin-thread-multi-2level/auto/DBI/ Writing Makefile for DBD::mysql make ABSPERL=$ABSPERL cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm cc -c -I/sw/lib/perl5/5.8.6/darwin-thread-multi-2level/auto/DBI - I/ sw/include/mysql -Wreturn-type -Wtrigraphs -W -Wformat -Wsign- compare -Wunused -fno-omit-frame-pointer -g - DDBD_MYSQL_INSERT_ID_IS_GOOD - g -g -pipe -fno-common - DPERL_DARWIN -no-cpp-precomp -fno-strict- aliasing -I/usr/local/ include -Os -DVERSION=\4.005\ -DXS_VERSION= \4.005\ -I/ System/Library/Perl/5.8.6/darwin-thread-multi-2level/ CORE dbdimp.c dbdimp.c: In function 'alloc_param': dbdimp.c:110: warning: comparison between signed and unsigned dbdimp.c: In function 'alloc_bind': dbdimp.c:128: warning: comparison between signed and unsigned dbdimp.c: In function 'alloc_fbind': dbdimp.c:144: warning: comparison between signed and unsigned dbdimp.c: In function 'alloc_fbuffer': dbdimp.c:159: warning: comparison between signed and unsigned dbdimp.c: In function 'parse_params': dbdimp.c:473: warning: comparison between signed and unsigned dbdimp.c: In function 'dbd_discon_all': dbdimp.c:1941: warning: unused variable 'imp_xxh' dbdimp.c: In function 'mysql_db_FETCH_attrib': dbdimp.c:2160: warning: unused parameter 'dbh' dbdimp.c: In function 'mysql_st_internal_execute': dbdimp.c:2788: warning: unused parameter 'attribs' dbdimp.c: In function 'mysql_st_FETCH_attrib': dbdimp.c:4035: warning: comparison between signed and unsigned dbdimp.c: In function 'mysql_st_blob_read': dbdimp.c:4144: warning: unused parameter 'sth' dbdimp.c:4145: warning: unused parameter 'imp_sth' dbdimp.c:4146: warning: unused parameter 'field' dbdimp.c:4147: warning: unused parameter 'offset' dbdimp.c:4148: warning: unused parameter 'len' dbdimp.c:4149: warning: unused parameter 'destrv' dbdimp.c:4150: warning: unused parameter 'destoffset' dbdimp.c: In function 'mysql_bind_ph': dbdimp.c:4308: warning: comparison between signed
Re: DBD::Oracle: 'no prototype' warnings (Borland)
Tim Bunce wrote: On Fri, Oct 01, 2004 at 01:46:45PM +0200, Steffen Goeldner wrote: Tim Bunce wrote: I can live with assuming support for ANSI C style prototypes since we already effectively require perl 5.6 and that requires ANSI C. O.k., attached are the KR = ANSI patches for dbdimp.c and oci8.c. Thanks, applied! Finally, a small patch to Makefile.PL that switches bcc to picky mode (force C++). Compiles like a charm: zero errors / zero warnings. Steffen --- Makefile.PL.origMon Sep 13 14:40:20 2004 +++ Makefile.PL Sat Oct 02 22:55:04 2004 @@ -62,6 +62,7 @@ $opts{CAPI} = 'TRUE' if $Config{archname} =~ /-object\b/i; } +$opts{CCFLAGS} = -P $Config{ccflags} if $Config{cc} eq 'bcc32'; # force C++ $opts{LINKTYPE} = 'static' if $Config{dlsrc} =~ /dl_none/; my(@MK, %MK, $MK_TEXT, %MK_expanding); # parsed macros from Oracle's makefiles
Re: DBD::Oracle: 'no prototype' warnings (Borland)
On Mon, Oct 04, 2004 at 03:58:54PM +0200, Steffen Goeldner wrote: Tim Bunce wrote: On Fri, Oct 01, 2004 at 01:46:45PM +0200, Steffen Goeldner wrote: Tim Bunce wrote: I can live with assuming support for ANSI C style prototypes since we already effectively require perl 5.6 and that requires ANSI C. O.k., attached are the KR = ANSI patches for dbdimp.c and oci8.c. Thanks, applied! Finally, a small patch to Makefile.PL that switches bcc to picky mode (force C++). Compiles like a charm: zero errors / zero warnings. Thanks, applied! Tim. Steffen --- Makefile.PL.orig Mon Sep 13 14:40:20 2004 +++ Makefile.PL Sat Oct 02 22:55:04 2004 @@ -62,6 +62,7 @@ $opts{CAPI} = 'TRUE' if $Config{archname} =~ /-object\b/i; } +$opts{CCFLAGS} = -P $Config{ccflags} if $Config{cc} eq 'bcc32'; # force C++ $opts{LINKTYPE} = 'static' if $Config{dlsrc} =~ /dl_none/; my(@MK, %MK, $MK_TEXT, %MK_expanding); # parsed macros from Oracle's makefiles
Re: DBD::Oracle: 'no prototype' warnings (Borland)
Tim Bunce wrote: I can live with assuming support for ANSI C style prototypes since we already effectively require perl 5.6 and that requires ANSI C. O.k., attached are the KR = ANSI patches for dbdimp.c and oci8.c. Steffen --- dbdimp.orig Thu Sep 30 14:26:04 2004 +++ dbdimp.cThu Sep 30 21:03:11 2004 @@ -102,8 +102,7 @@ } void -dbd_init(dbistate) -dbistate_t *dbistate; +dbd_init(dbistate_t *dbistate) { char *p; DBIS = dbistate; @@ -149,8 +148,7 @@ int -ora_dbtype_is_long(dbtype) -int dbtype; +ora_dbtype_is_long(int dbtype) { /* Is it a LONG, LONG RAW, LONG VARCHAR or LONG VARRAW type? */ /* Return preferred type code to use if it's a long, else 0. */ @@ -164,8 +162,7 @@ } static int -oratype_bind_ok(dbtype)/* It's a type we support for placeholders */ -int dbtype; +oratype_bind_ok(int dbtype) /* It's a type we support for placeholders */ { /* basically we support types that can be returned as strings */ switch(dbtype) { @@ -220,8 +217,7 @@ int -dbd_db_login(dbh, imp_dbh, dbname, uid, pwd) -SV *dbh; imp_dbh_t *imp_dbh; char *dbname; char *uid; char *pwd; +dbd_db_login(SV *dbh, imp_dbh_t *imp_dbh, char *dbname, char *uid, char *pwd) { return dbd_db_login6(dbh, imp_dbh, dbname, uid, pwd, Nullsv); } @@ -238,13 +234,7 @@ int -dbd_db_login6(dbh, imp_dbh, dbname, uid, pwd, attr) -SV *dbh; -imp_dbh_t *imp_dbh; -char *dbname; -char *uid; -char *pwd; -SV *attr; +dbd_db_login6(SV *dbh, imp_dbh_t *imp_dbh, char *dbname, char *uid, char *pwd, SV *attr) { dTHR; sword status; @@ -651,9 +641,7 @@ int -dbd_db_commit(dbh, imp_dbh) -SV *dbh; -imp_dbh_t *imp_dbh; +dbd_db_commit(SV *dbh, imp_dbh_t *imp_dbh) { sword status; OCITransCommit_log_stat(imp_dbh-svchp, imp_dbh-errhp, OCI_DEFAULT, status); @@ -668,9 +656,7 @@ int -dbd_st_cancel(sth, imp_sth) -SV *sth; -imp_sth_t *imp_sth; +dbd_st_cancel(SV *sth, imp_sth_t *imp_sth) { sword status; status = OCIBreak(imp_sth-svchp, imp_sth-errhp); @@ -684,9 +670,7 @@ int -dbd_db_rollback(dbh, imp_dbh) -SV *dbh; -imp_dbh_t *imp_dbh; +dbd_db_rollback(SV *dbh, imp_dbh_t *imp_dbh) { sword status; OCITransRollback_log_stat(imp_dbh-svchp, imp_dbh-errhp, OCI_DEFAULT, status); @@ -699,9 +683,7 @@ int -dbd_db_disconnect(dbh, imp_dbh) -SV *dbh; -imp_dbh_t *imp_dbh; +dbd_db_disconnect(SV *dbh, imp_dbh_t *imp_dbh) { dTHR; int refcnt = 1 ; @@ -738,9 +720,7 @@ void -dbd_db_destroy(dbh, imp_dbh) -SV *dbh; -imp_dbh_t *imp_dbh; +dbd_db_destroy(SV *dbh, imp_dbh_t *imp_dbh) { dTHX ; int refcnt = 1 ; @@ -772,11 +752,7 @@ int -dbd_db_STORE_attrib(dbh, imp_dbh, keysv, valuesv) -SV *dbh; -imp_dbh_t *imp_dbh; -SV *keysv; -SV *valuesv; +dbd_db_STORE_attrib(SV *dbh, imp_dbh_t *imp_dbh, SV *keysv, SV *valuesv) { STRLEN kl; char *key = SvPV(keysv,kl); @@ -809,10 +785,7 @@ SV * -dbd_db_FETCH_attrib(dbh, imp_dbh, keysv) -SV *dbh; -imp_dbh_t *imp_dbh; -SV *keysv; +dbd_db_FETCH_attrib(SV *dbh, imp_dbh_t *imp_dbh, SV *keysv) { STRLEN kl; char *key = SvPV(keysv,kl); @@ -857,9 +830,7 @@ void -dbd_preparse(imp_sth, statement) -imp_sth_t *imp_sth; -char *statement; +dbd_preparse(imp_sth_t *imp_sth, char *statement) { D_imp_dbh_from_sth; bool in_literal = FALSE; @@ -984,8 +955,7 @@ int -calc_cache_rows(num_fields, est_width, cache_rows, has_longs) -int num_fields, est_width, cache_rows, has_longs; +calc_cache_rows(int num_fields, int est_width, int cache_rows, int has_longs) { /* Use guessed average on-the-wire row width calculated above */ /* and add in overhead of 5 bytes per field plus 8 bytes per row. */ @@ -1023,10 +993,7 @@ static int -ora_sql_type(imp_sth, name, sql_type) -imp_sth_t *imp_sth; -char *name; -int sql_type; +ora_sql_type(imp_sth_t *imp_sth, char *name, int sql_type) { /* XXX should detect DBI reserved standard type range here */ @@ -1076,11 +1043,7 @@ static int -dbd_rebind_ph_char(sth, imp_sth, phs, alen_ptr_ptr) -SV *sth; -imp_sth_t *imp_sth; -phs_t *phs; -ub2 **alen_ptr_ptr; +dbd_rebind_ph_char(SV *sth, imp_sth_t *imp_sth, phs_t *phs, ub2 **alen_ptr_ptr) { STRLEN value_len; int at_exec = 0; @@ -1293,10 +1256,7 @@ static int -dbd_rebind_ph(sth, imp_sth, phs) -SV *sth; -imp_sth_t *imp_sth; -phs_t *phs; +dbd_rebind_ph(SV *sth, imp_sth_t *imp_sth, phs_t *phs) { ub2 *alen_ptr = NULL; sword status; @@ -1397,15 +1357,7 @@ int -dbd_bind_ph(sth, imp_sth, ph_namesv, newvalue, sql_type, attribs, is_inout, maxlen) -SV *sth; -imp_sth_t *imp_sth; -SV *ph_namesv; -SV *newvalue; -IV sql_type; -SV *attribs; -int is_inout; -IV maxlen; +dbd_bind_ph(SV *sth, imp_sth_t *imp_sth, SV *ph_namesv, SV *newvalue, IV sql_type, SV
Re: DBD::Oracle: 'no prototype' warnings (Borland)
On Fri, Oct 01, 2004 at 01:46:45PM +0200, Steffen Goeldner wrote: Tim Bunce wrote: I can live with assuming support for ANSI C style prototypes since we already effectively require perl 5.6 and that requires ANSI C. O.k., attached are the KR = ANSI patches for dbdimp.c and oci8.c. Thanks, applied! Tim.
Re: DBD::Oracle: 'no prototype' warnings (Borland)
On Thu, Sep 30, 2004 at 10:29:25AM +0200, Steffen Goeldner wrote: Tim Bunce wrote: On Wed, Sep 22, 2004 at 03:52:09PM +0200, Steffen Goeldner wrote: Compiling DBD::Oracle with Borland C++ 5.5, I have a bunch of warnings: [...] 1. ignore the warnings :-( 2. suppress the warnings (-w-8065) 3. Force __STDC__=1 4. Force C++ compile (-P): 5. Remove the #if/#else/#include ocik/#endif So you're just left with #include ociapr.h #include ociap.h (Ignore me, I thought that logic was in dbdimp.h) Or I add __BORLANDC__ to the #if. I'm curious if Oracle would accept this patch ... You might spend half you're life waiting to find out, and then it'll only apply to Oracle 11 onwards :) I can live with assuming support for ANSI C style prototypes since we already effectively require perl 5.6 and that requires ANSI C. Would that work? (If so, patch welcome :) I'd be happy with option 4 or 3c. (There are a bunch of hacks in there already, so adding another wouldn't be too bad :-) Would you accept these patches? As an example, the attached patch adds the casts to dbdimp.c. They're useful anyway - applied. O.k., attached are the casts required by my compiler for oci8.c. I'm not sure about the (imp_fbh_st*) cast - maybe this should be (imp_fbh_t*)? Applied. Thanks. Tim.
Re: DBD::Oracle: 'no prototype' warnings (Borland)
Tim Bunce wrote: On Wed, Sep 22, 2004 at 03:52:09PM +0200, Steffen Goeldner wrote: Compiling DBD::Oracle with Borland C++ 5.5, I have a bunch of warnings: [...] 1. ignore the warnings :-( 2. suppress the warnings (-w-8065) 3. Force __STDC__=1 4. Force C++ compile (-P): 5. Remove the #if/#else/#include ocik/#endif So you're just left with #include ociapr.h #include ociap.h Or I add __BORLANDC__ to the #if. I'm curious if Oracle would accept this patch ... I can live with assuming support for ANSI C style prototypes since we already effectively require perl 5.6 and that requires ANSI C. Would that work? (If so, patch welcome :) Would you accept these patches? As an example, the attached patch adds the casts to dbdimp.c. They're useful anyway - applied. O.k., attached are the casts required by my compiler for oci8.c. I'm not sure about the (imp_fbh_st*) cast - maybe this should be (imp_fbh_t*)? Steffen --- oci8.orig Mon Sep 27 09:24:48 2004 +++ oci8.c Wed Sep 29 22:15:00 2004 @@ -360,7 +360,7 @@ dbd_phs_in(dvoid *octxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp) { -phs_t *phs = octxp; +phs_t *phs = (phs_t*)octxp; STRLEN phs_len; if (phs-desc_h) { *bufpp = phs-desc_h; @@ -441,7 +441,7 @@ /* value or a pointer to an indicator structure for named data types. */ ub2 **rcodepp) /* Returns a pointer to contains the return code. */ { -phs_t *phs = octxp;/* context */ +phs_t *phs = (phs_t*)octxp;/* context */ /*imp_sth_t *imp_sth = phs-imp_sth;*/ if (phs-desc_h) { @@ -632,7 +632,7 @@ } } phs-indp = (SvOK(phs-sv)) ? 0 : -1; -phs-progv = (void*)phs-desc_h; +phs-progv = (char*)phs-desc_h; phs-maxlen = sizeof(OCILobLocator*); if (phs-is_inout) phs-out_prepost_exec = lob_phs_post_execute; @@ -1089,7 +1089,7 @@ fbh-field_num = i; OCIParamGet_log_stat(imp_sth-stmhp, OCI_HTYPE_STMT, imp_sth-errhp, - (dvoid*)fbh-parmdp, (ub4)i, status); + (dvoid**)fbh-parmdp, (ub4)i, status); if (status != OCI_SUCCESS) { oci_error(h, imp_sth-errhp, status, OCIParamGet); return 0; @@ -1578,7 +1578,7 @@ ++src; *len = src - start; if (copy) { - p = alloc_via_sv(*len, 0, 1); + p = (char*)alloc_via_sv(*len, 0, 1); strncpy(p, start, *len); p[*len] = '\0'; return p; @@ -1753,7 +1753,7 @@ Newz(1, lr, 1, lob_refetch_t); unmatched_params = 0; lr-num_fields = 0; -lr-fbh_ary = alloc_via_sv(sizeof(imp_fbh_t) * HvKEYS(lob_cols_hv)+1, +lr-fbh_ary = (imp_fbh_st*)alloc_via_sv(sizeof(imp_fbh_t) * HvKEYS(lob_cols_hv)+1, lr-fbh_ary_sv, 0); sql_select = sv_2mortal(newSVpv(select ,0)); @@ -1952,12 +1952,12 @@ } else if (amtp 0) {/* since amtp==0 OCI_ONE_PIECE fail (OCI 8.0.4) */ if( ! fbh-csid ) { -OCILobCharSetForm_log_stat( imp_sth-envhp, errhp, fbh-desc_h, csform, status ); +OCILobCharSetForm_log_stat( imp_sth-envhp, errhp, (OCILobLocator*)fbh-desc_h, csform, status ); if (status != OCI_SUCCESS) { return oci_error(sth, errhp, status, OCILobCharSetForm); } #ifdef OCI_ATTR_CHARSET_ID -OCILobCharSetId_log_stat( imp_sth-envhp, errhp, fbh-desc_h, csid, status ); +OCILobCharSetId_log_stat( imp_sth-envhp, errhp, (OCILobLocator*)fbh-desc_h, csid, status ); if (status != OCI_SUCCESS) { return oci_error(sth, errhp, status, OCILobCharSetId); } @@ -1978,14 +1978,14 @@ PerlIO_printf(DBILOGFP, calling OCILobWrite fbh-csid=%d fbh-csform=%d amtp=%d\n, fbh-csid, fbh-csform, amtp ); OCILobWrite_log_stat(imp_sth-svchp, errhp, - fbh-desc_h, amtp, 1, SvPVX(phs-sv), amtp, OCI_ONE_PIECE, + (OCILobLocator*)fbh-desc_h, amtp, 1, SvPVX(phs-sv), amtp, OCI_ONE_PIECE, 0,0, fbh-csid ,fbh-csform, status); if (status != OCI_SUCCESS) { return oci_error(sth, errhp, status, OCILobWrite in post_execute_lobs); } } else { /* amtp==0 so truncate LOB to zero length */ - OCILobTrim_log_stat(imp_sth-svchp, errhp, fbh-desc_h, 0, status); + OCILobTrim_log_stat(imp_sth-svchp, errhp, (OCILobLocator*)fbh-desc_h, 0, status); if (status != OCI_SUCCESS) { return oci_error(sth, errhp, status, OCILobTrim in post_execute_lobs); }
DBD::Oracle: 'no prototype' warnings (Borland)
Compiling DBD::Oracle with Borland C++ 5.5, I have a bunch of warnings: Warning W8065 ...: Call to function 'OCI...' with no prototype in function because oci.h includes the KR headers: #if defined(__STDC__) || defined(__cplusplus) #include ociapr.h #include ociap.h #else #include ocikpr.h #include ocikp.h #endif That means, neither __STDC__ nor __cplusplus is defined. These are predefined macros: __STDC__ = 1 Defined if you compile with the -A compiler option; otherwise, it is undefined. _cplusplus = 1 Defined if in C++ mode; otherwise, undefined. and depend on these command-line switches: Language compliance options: -A ANSI -A- Borland extensions General compiler output options: -P The -P command-line option causes the compiler to compile all source files as C++ files, regardless of their extension. Use -P- to compile all .CPP files as C++ source files and all other files as C source files. Now, I have the following options: 1. ignore the warnings :-( 2. suppress the warnings (-w-8065) 3. Force __STDC__=1 a) command-line switch -A: win*.h don't compile (non-standard keywords) b) #define __STDC__ 1: even in this case some files don't compile c) #define/#undef around #include oci.h: works, but quite hackerish 4. Force C++ compile (-P): Warnings: Style of function definition is now obsolete Errors : Error E2034 ...: Cannot convert '...' to '...' in function If I go the C++ route, I'd need to add some casts to avoid the errors and convert KR style functions to ANSI. Would you accept these patches? As an example, the attached patch adds the casts to dbdimp.c. Steffen --- dbdimp.orig Fri Aug 06 17:54:00 2004 +++ dbdimp.cMon Sep 20 22:18:54 2004 @@ -1226,7 +1226,7 @@ phs-desc_t = OCI_HTYPE_STMT; OCIHandleAlloc_ok(imp_sth-envhp, phs-desc_h, phs-desc_t, status); } - phs-progv = (void*)phs-desc_h; + phs-progv = (char*)phs-desc_h; phs-maxlen = 0; OCIBindByName_log_stat(imp_sth-stmhp, phs-bndhp, imp_sth-errhp, (text*)phs-name, (sb4)strlen(phs-name), @@ -1274,7 +1274,7 @@ imp_sth_csr-svchp = imp_sth-svchp; /* assign statement handle from placeholder descriptor */ - imp_sth_csr-stmhp = phs-desc_h; + imp_sth_csr-stmhp = (OCIStmt*)phs-desc_h; phs-desc_h = NULL; /* tell phs that we own it now*/ /* force stmt_type since OCIAttrGet(OCI_ATTR_STMT_TYPE) doesn't work! */
New DBI mechanisms for handling SUCCESS_WITH_INFO and warnings
Here's how this has all panned out... Changes says: Changed set_err() to append to errstr, with a leading \n if it's not empty, so that multiple error/warning messages are recorded. Added way for drivers to indicate 'success with info' or 'warning' by setting err to 0 for warning and for information. Both values are false and so don't trigger RaiseError etc. Warnings (err=0) are automatically printed if PrintError is set. Thanks to Steffen Goeldner for the original idea. Added $h-{HandleSetError} = sub { ... } to be called at the point that an error, warn, or info state is recorded. The code can alter the err, errstr, and state values (e.g., to promote an error to a warning, or the reverse). The set_err() docs now read: =item Cset_err $rv = $h-set_err($err, $errstr); $rv = $h-set_err($err, $errstr, $state); $rv = $h-set_err($err, $errstr, $state, $method); $rv = $h-set_err($err, $errstr, $state, $method, $rv); Set the Cerr, Cerrstr, and Cstate values for the handle. This method is typically only used by DBI drivers and DBI subclasses. If the L/HandleSetError attribute holds a reference to a subroutine it is called first. The subroutine can alter the $err, $errstr, $state, and $method values. See L/HandleSetError for full details. If the subroutine returns a true value then the handle Cerr, Cerrstr, and Cstate values are not altered and set_err() returns an empty list (it normally returns $rv which defaults to undef, see below). Setting Cerr to a Itrue value indicates an error and will trigger the normal DBI error handling mechanisms, such as CRaiseError and CHandleError, if they are enabled, when execution returns from the DBI back to the application. Setting Cerr to C indicates an 'information' state, and setting it to C0 indicates a 'warning' state. The $method parameter provides an alternate method name for the CRaiseError/CPrintError error string instead of the fairly unhelpful 'Cset_err'. The Cset_err method normally returns undef. The $rv parameter provides an alternate return value. Some special rules apply if the Cerr or Cerrstr values for the handle are already set... If Cerrstr is true then: C [err was %s now %s] is appended if $err is true and Cerr is already true; C [state was %s now %s] is appended if $state is true and Cstate is already true; then C\n and the new $errstr are appended. Obviously the C%s's above are replaced by the corresponding values. The handle Cerr value is set to $err if: $err is true; or handle Cerr value is undef; or $err is defined and the length is greater than the handle Cerr length. The effect is that an 'information' state only overides undef; a 'warning' overrides undef or 'information', and an 'error' state overrides anything. The handle Cstate value is set to $state if $state is true and the handle Cerr value was set (by the rules above). And HandleSetError docs are: =item CHandleSetError (code ref, inherited) The CHandleSetError attribute can be used to intercept the setting of handle Cerr, Cerrstr, and Cstate values. If set to a reference to a subroutine then that subroutine is called whenever set_err() is called, typically by the driver or a subclass. The subroutine is called with five arguments, the first five that were passed to set_err(): the handle, the Cerr, Cerrstr, and Cstate values being set, and the method name. These can be altered by changing the values in the @_ array. The return value affects set_err() behaviour, see L/set_err for details. It is possible to 'stack' multiple HandleSetError handlers by using closures. See L/HandleError for an example. The CHandleSetError and CHandleError subroutines differ in subtle but significant ways. HandleError is only invoked at the point where the DBI is about to return to the application with Cerr set true. It's not invoked by the failure of a method that's been caled by another DBI method. HandleSetError, on the other hand, is called whenever set_err() is called with a defined Cerr value, even if false. So it's not just for errors, despite the name, but also warn and info states. The set_err method, and thus HandleSetError, may be called multiple times within a method and is usually invoked from deep within driver code. In theory a driver can use the return value from HandleSetError via set_err() to decide whether to continue or not. If set_err() returns an empty list, indicating that the HandleSetError code has 'handled' the 'error', the driver could then continue instead of failing (if that's a reasonable thing to do). This isn't excepted to be common and any such cases should be clearly marked in the driver documentation. Comments most welcome. Pure-perl drivers should already be using $h-set_err to record errors. Compiled drivers are probably not, just setting err and errstr directly. I'll provide
Re: DBI 1.31 Warnings
Thanks. There're harmless but I've fixed them for the next release. Tim. On Sat, Nov 30, 2002 at 11:33:38AM -0800, David Wheeler wrote: I got some warnings while compiling DBI 1.31 on Mac OS X 10.2.2. Here's the version of gcc I'm using: mercury% cc -v Reading specs from /usr/libexec/gcc/darwin/ppc/3.1/specs Thread model: posix Apple Computer, Inc. GCC version 1161, based on gcc version 3.1 20020420 (prerelease) and the warnings: /usr/local/bin/perl /usr/local/lib/perl5/5.8.0/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.8.0/ExtUtils/typemap Perl.xs Perl.xsc mv Perl.xsc Perl.c cc -c -I/sw/include -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -O3 -DVERSION=\1.31\ -DXS_VERSION=\1.31\ -I/usr/local/lib/perl5/5.8.0/darwin/CORE -Wall -Wno-comment -DDBI_NO_THREADS Perl.c Perl.xsi: In function `XS_DBD__Perl__st__prepare': Perl.xsi:303: warning: operation on `lna' may be undefined Perl.xsi: In function `XS_DBD__Perl__st_bind_param': Perl.xsi:339: warning: operation on `lna' may be undefined Perl.xsi: In function `XS_DBD__Perl__st_bind_param_inout': Perl.xsi:375: warning: operation on `lna' may be undefined /usr/local/bin/perl /usr/local/lib/perl5/5.8.0/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.8.0/ExtUtils/typemap DBI.xs DBI.xsc mv DBI.xsc DBI.c cc -c -I/sw/include -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -O3 -DVERSION=\1.31\ -DXS_VERSION=\1.31\ -I/usr/local/lib/perl5/5.8.0/darwin/CORE -Wall -Wno-comment -DDBI_NO_THREADS DBI.c In file included from DBI.xs:1355: DBI.xs: In function `dbih_set_attr_k': DBI.xs:536: warning: passing arg 0 of `set_trace' from incompatible pointer type DBI.xs: In function `XS_DBD_st_bind_col': DBI.xs:3366: warning: operation on `lna' may be undefined DBI.xs: In function `XS_DBD_st_bind_columns': DBI.xs:3387: warning: operation on `lna' may be undefined Regards, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e Jabber: [EMAIL PROTECTED]
DBI 1.31 Warnings
I got some warnings while compiling DBI 1.31 on Mac OS X 10.2.2. Here's the version of gcc I'm using: mercury% cc -v Reading specs from /usr/libexec/gcc/darwin/ppc/3.1/specs Thread model: posix Apple Computer, Inc. GCC version 1161, based on gcc version 3.1 20020420 (prerelease) and the warnings: /usr/local/bin/perl /usr/local/lib/perl5/5.8.0/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.8.0/ExtUtils/typemap Perl.xs Perl.xsc mv Perl.xsc Perl.c cc -c -I/sw/include -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -O3 -DVERSION=\1.31\ -DXS_VERSION=\1.31\ -I/usr/local/lib/perl5/5.8.0/darwin/CORE -Wall -Wno-comment -DDBI_NO_THREADS Perl.c Perl.xsi: In function `XS_DBD__Perl__st__prepare': Perl.xsi:303: warning: operation on `lna' may be undefined Perl.xsi: In function `XS_DBD__Perl__st_bind_param': Perl.xsi:339: warning: operation on `lna' may be undefined Perl.xsi: In function `XS_DBD__Perl__st_bind_param_inout': Perl.xsi:375: warning: operation on `lna' may be undefined /usr/local/bin/perl /usr/local/lib/perl5/5.8.0/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.8.0/ExtUtils/typemap DBI.xs DBI.xsc mv DBI.xsc DBI.c cc -c -I/sw/include -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -O3 -DVERSION=\1.31\ -DXS_VERSION=\1.31\ -I/usr/local/lib/perl5/5.8.0/darwin/CORE -Wall -Wno-comment -DDBI_NO_THREADS DBI.c In file included from DBI.xs:1355: DBI.xs: In function `dbih_set_attr_k': DBI.xs:536: warning: passing arg 0 of `set_trace' from incompatible pointer type DBI.xs: In function `XS_DBD_st_bind_col': DBI.xs:3366: warning: operation on `lna' may be undefined DBI.xs: In function `XS_DBD_st_bind_columns': DBI.xs:3387: warning: operation on `lna' may be undefined Regards, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e Jabber: [EMAIL PROTECTED]