Skip to content

compiler warning #163

@rwfranks

Description

@rwfranks

Transcribed verbatim from CPAN RT#129760, warts and all.

Thu Jun 06 11:11:28 2019 HVDS [...] cpan.org - Ticket created
Subject: compiler warning

Building DBI-1.642 I see this:

DBI.c: In function 'XS_DBD_____db_take_imp_data':
DBI.xs:5175:16: warning: 'mg' may be used uninitialized in this function [-Wmaybe-uninitialized]
     mg->mg_obj = Nullsv;        /* sever the link from handle to imp_xxh */
DBI.xs:5087:12: note: 'mg' was declared here
     MAGIC *mg;

Looking at the code, I see mg is intended to be supplied by the preceding call to dbih_getcom2(), but that has a couple of non-fatal failure modes signalled by returning 0, which the call here does not check for. Fixing it might require no more than to croak() if dbih_getcom2() returns false, but there may be better approaches.

Hugo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions