[m-rev.] for review: deconstruct.named_arg for java

Paul Bone pbone at csse.unimelb.edu.au
Mon Jul 5 15:18:38 AEST 2010


On Mon, Jul 05, 2010 at 02:35:32PM +1000, Ian MacLarty wrote:
> On Mon, Jul 5, 2010 at 2:21 PM, Paul Bone <pbone at csse.unimelb.edu.au> wrote:
> > On Mon, Jul 05, 2010 at 02:04:23PM +1000, Ian MacLarty wrote:
> >>
> >> What seems to be happening is that functions are being declared with
> >> a prototype like the following:
> >>
> >>     static void mercury__tree234__LCMCpr_insert2_1_4_0(void) __asm__("_entry_" "mercury__tree234__LCMCpr_insert2_1_4_0")
> >>
> >> and then being referred to without being defined in C code.
> >> The functions are in fact defined using assembly code.
> >>
> >> It seems to be the fact that the function is declared static that is
> >> causing gcc to expect a definition of the function in the same file.
> >> Removing the static keyword appears to fix the problem.
> >>
> >> Here is the hack I used to test this:
> >
> > Why is there a static definition but no declaration?  In other words, are these
> > symbols really indented to be static?
> >
> 
> There is a static declaration.  It is the definition that is missing.
> I'm not sure if the static keyword makes any difference if the
> function is defined in assembler.  It doesn't appear to (running nm on
> the .o files yields the same results).
>
> > If this is true then they should be created using a different preprocessor
> > macro, rather than making a static macro create non-static declarations.
> >
> 
> Yes I know.  That was just a hack I used to test my theory.

Ah, okay.

> > Alternativly, is there a missing (static) definition of these symbols?  I
> > wouldn't think so otherwise the linker wuld fail to link the executable.  Can
> > GCC see the static definitions if they exist?
> 
> The definition, as far as I can tell, is done with some inline
> assembler.  There is no C code definition of the function, which is
> why gcc complains.

In that case I'm happy to use a new macro that doesn't make the definition
static.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 489 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20100705/043a5024/attachment.sig>


More information about the reviews mailing list