On Tue, Jul 13, 2004 at 02:52:05PM -0000, BrownB wrote:
> I found some problems passing pointers to allocated memory chunks
> between functions located in different segments.

I am aware of no particular problems in passing such pointers between
functions in different sections.

> In this example, when I call func2() from main() I get a runtime
> error, while putting func2() in segment Seg1 (i.e. .TEXT segment...)
> doesn't give any error.

The code you have shown contains no main() function, so it is difficult
to comment on what particular user error it is that you have made.

But the declaration of func2() in this file (rather than in a header)
suggests that it may be that no declaration of func2() is visible from
this call site in the definition of main(), and that user error is the
most common cause of this sort of problem.  That fact is noted in the
documentation, along with a recommendation to compile with -Wall and/or
-Wmissing-declarations to detect your error.

    John

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to