After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 615305 - Template class' method returning template object issues gcc warning
Template class' method returning template object issues gcc warning
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: general
0.8.x
Other Linux
: Normal minor
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks: 688447
 
 
Reported: 2010-04-09 16:36 UTC by Aleksander Wabik
Modified: 2018-05-22 13:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Aleksander Wabik 2010-04-09 16:36:06 UTC
Testcase:

//-------------------------------------------
public class TmplClass<K>
{
        public K[]? obj;
        
        public K[]? get_obj()
        {
                return obj;
        }
}
 
void main()
{
        TmplClass<int> test = new TmplClass<int>();
        int[] a;
        a = test.get_obj();     
}
 //-------------------------------------------

Result of compilation:

/tmp/test.vala.c: In function '_vala_main':
/tmp/test.vala.c:280: warning: assignment from incompatible pointer type

Cause of bug:

This bug is caused by translating method TmplClass.get_obj() to returning gpointer* in C, but this gpointer* is not being cast to int** where this method is being called on object of template type TmplClass<int>.

Other effects:

This bug does not make code broken. It only issues not needed warning.
Comment 1 GNOME Infrastructure Team 2018-05-22 13:32:44 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/85.