Bug 79235 - bad source code
bad source code
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: perl-DBI (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Warren Togami
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-08 05:43 EST by d.binderman
Modified: 2007-04-18 12:48 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-28 03:09:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2002-12-08 05:43:28 EST
Description of Problem:

Hello there,

I just tried to compile package perl-DBI-1.30-1 from Redhat 8.0.

Here are some of the compiler messages.

Perl.xsi:303: warning: operation on `lna' may be undefined
Perl.xsi:339: warning: operation on `lna' may be undefined
Perl.xsi:375: warning: operation on `lna' may be undefined
DBI.xs:3347: warning: operation on `lna' may be undefined
DBI.xs:3368: warning: operation on `lna' may be undefined

I don't have a fix for the problem, but it seems to be around line
447 of DBIXS.h

#define DBD_ATTRIBS_CHECK(func, h, attribs)     \
    if ((attribs) && SvOK(attribs)) {           \
        STRLEN lna=0;                           \
        if (!SvROK(attribs) || SvTYPE(SvRV(attribs))!=SVt_PVHV)         \
            croak("%s->%s(...): attribute parameter '%s' is not a hash ref",
\
                    SvPV(h,lna), func, SvPV(attribs,lna));              \
    } else (attribs) = Nullsv

I suspect that the SvPV macro increments its second parameter,
causing the compiler to complain.

The fix would then be to introduce some temporary variables for
the results of SvPV(h,lna) and SvPV(attribs,lna) something like this

#define DBD_ATTRIBS_CHECK(func, h, attribs)     \
    if ((attribs) && SvOK(attribs)) {           \
        STRLEN lna=0;                           \
        if (!SvROK(attribs) || SvTYPE(SvRV(attribs))!=SVt_PVHV)         \
		{ \
			char * tmp1 = SvPV(h,lna); \
			char * tmp2 = SvPV(attribs,lna); \
            croak("%s->%s(...): attribute parameter '%s' is not a hash ref",
\
                    tmp1, func, tmp2);              \
    } else (attribs) = Nullsv


Version-Release number of selected component (if applicable):


How Reproducible:


Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:

Note You need to log in before you can comment on or make changes to this bug.