Couple of bugs

John Tytgat John.Tytgat at aaug.net
Fri Sep 21 11:36:04 BST 2007


In message <yekvea4cq3x.fsf at dellow.uk.cyberscience.com>
          Tom Hughes <tom at compton.nu> wrote:

> In message <e5d2bd254f.Jo at hobbes.bass-software.com>
>         John Tytgat <John.Tytgat at aaug.net> wrote:
> 
> > In message <dc92b6224f.christian at venice.lab>
> >           Christian Ludlam <christian at recoil.org> wrote:
> >
> >> * draganobject_function is an anonymous structure, which means Norcroft
> >>   generates "cast between function and non-function" warnings. Does DefMod
> >>   not provide a "function" fundamental type?
> >
> > It does.  The "function" type is also used in the PCI swi interface file
> > but it is not clear to me if this is the same APCS interface as for
> > DragAnAobject swi.

Apologies, this is wrong.  There is no "function" type in defmod2 at all.
I got confused with its "function" argument name.

> The problem is that DefMod doesn't have a syntax to fully describe
> functions and their arguments so it can't spit out a proper prototype
> and instead the function type in DefMod is just mapped to void * in
> the C output I think.

Indeed, very true.

> A lot of the function points taken by SWIs are not very amenable to
> being represented as C prototypes anyway I suspect...

That's correct but AFAIK a possible APCS-32 'function' type can currently
only be used for DragAnObject and SharedCLibrary.  All other 'function'
alike situations use .Asm type.

Note that mixing up data and function pointers can give problems when
writing module code as the global variable former ones are being relocated
to the module workspace while global variable function pointers aren't.

John.
-- 
John Tytgat, in his comfy chair at home                                 BASS
John.Tytgat at aaug.net                             ARM powered, RISC OS driven



More information about the oslib-user mailing list