Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#6898 closed defect (fixed)

swig perl non void function return garbage

Reported by: brunofriedmann Owned by: Ari Jolma
Priority: normal Milestone:
Component: PerlBindings Version: 2.2.0
Severity: normal Keywords:
Cc:

Description

Trying to update our openSUSE package to version 2.2.0 I receive a error check from our bot code checker about functions that are non void, but return undefine data.

swig/perl/gdal_wrap.cpp line 1828 AV* to_array_classifier(SV* classifier, int* comparison, const char error){}

This is also present in swig/include/perl/band.i line 89

I've created a patch (but please consider my knowledge of C and swig being very low). The software build correctly on our tools Patch attached for review.

Attachments (1)

fix-non-void-return.patch (1.5 KB) - added by brunofriedmann 3 months ago.
Proposed patch to fix non-void function return garbage

Download all attachments as: .zip

Change History (5)

Changed 3 months ago by brunofriedmann

Attachment: fix-non-void-return.patch added

Proposed patch to fix non-void function return garbage

comment:1 Changed 3 months ago by Ari Jolma

Thanks for this. The code is indeed a bit sloppy and for new (and should be marked as experimental) methods. I'll fix these.

Last edited 3 months ago by Ari Jolma (previous) (diff)

comment:2 Changed 3 months ago by Ari Jolma

Resolution: fixed
Status: newclosed

In 38636:

Perl bindings: always return something from non-void functions. Fixes #6898.

comment:3 Changed 3 months ago by Ari Jolma

In 38637:

Perl bindings: always return something from non-void functions. Fixes #6898.

comment:4 Changed 3 months ago by brunofriedmann

Thanks Ari, I've picked your patches in my build now, waiting next bugfix release.

Note: See TracTickets for help on using tickets.