GNU Pascal Homepage - gpc - gpc-announce - gpc-de - gpc-doc
Diese Seite auf deutsch

Mail #9766

Back to main page of archive

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  

From: Eike Lange
Subject: Object type as function result?
Date: 16 Dec 2003, 17:05:41

Hi Folks!

On Die, Dez 16, 2003 at 03:29:54 +0100, Markus Gerwinski wrote:
> when declaring something like
>   type
>     tFoo = object
>       ...
>     end;
>   Function bar ( ... ) = result: tFoo;
> is there a way to suppress this warning:
>   optest.pas:53: warning: object type declared as function result type

There is no such warning if you use "pFoo":

  function bar (x: Integer) = result: pFoo;
  begin
    result := new (pFoo, Init)
  end;

If that is not what you want, could you give me
some code to play with?

Eike

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  


Replies

Author Subject Date
Markus Gerwinski Skipped: Object type as function result? 16 Dec 2003, 19:17:20
Markus Gerwinski Skipped: Object type as function result? 19 Dec 2003, 19:03:25
Frank Heckenbach Skipped: Object type as function 31 Dec 2003, 02:44:37

In reply to

Author Subject Date
Markus Gerwinski Object type as function result? 16 Dec 2003, 15:29:54

Back to main page of archive


Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.

Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.


This page was created by Crystal 0.999 (Linux 2.4.27/i686).