comp.lang.ada
 help / color / mirror / Atom feed
From: "k_leau" <k_leau@yahoo.com>
Subject: warning: cannot return a local value by reference
Date: Thu, 3 Jun 2004 00:11:08 +0200
Date: 2004-06-03T00:11:12+02:00	[thread overview]
Message-ID: <40be5080$0$9181$626a14ce@news.free.fr> (raw)

Hello,

I am new to Ada programming and I have the following problem:

I am using the APQ binding for working with Postgresql.

I have created the following spec "item_dbm_cls.ads" with the following:

with item_cls, apq.postgresql.client;
use item_cls, apq, apq.postgresql, apq.postgresql.client;

package item_dbm_cls is
    type item_dbm is limited private;
    function new_item_dbm(it_dbm: item_dbm) return item_dbm;

private
    type item_dbm is record
        it: item;
        connection: connection_type;
    end record;

end item_dbm_cls;

---------------------------------------
And a body "item_dbm_cls.adb" with:

package body item_dbm_cls is
    function new_item_dbm(it_dbm: item_dbm) return item_dbm is
        i_dbm: item_dbm;
    begin
        set_host_name(i_dbm.connection, host_name(it_dbm.connection));
    return i_dbm;
    end new_item_dbm;

end item_dbm_cls;

Why do I have this warning?
What mistake have I done? 

Thanks for any help.




             reply	other threads:[~2004-06-02 22:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-02 22:11 k_leau [this message]
2004-06-02 22:36 ` warning: cannot return a local value by reference Georg Bauhaus
2004-06-02 22:49   ` k_leau
2004-06-03  8:23 ` Martin Krischik
2004-06-03 10:02   ` k_leau
2004-06-03 10:37     ` Martin Krischik
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox