<< Back to previous view

[PCC-123] static inline functions need reference counting rather than just reference noting Created: 04/Apr/10  Updated: 01/May/14

Status: Closed
Project: pcc
Component/s: pcc backend
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Iain Hibbert Assignee: Anders Magnusson
Resolution: Won't Fix Votes: 0
Environment: NetBSD


 Description   
if static inline function A is referred to by static inline function B which itself is unused, it will still be emitted. Consider the following code fragment

void tomato (void);

static inline void potato (void)
{
        tomato();
}

static inline void legato (void)
{
        potato();
}

int
main(int ac, char *av[])
{
        return 0;
}

which will fail to link because of undefined reference to 'tomato.'. When built with -c, nm shows

0000000c T main
00000000 t potato
                U tomato

I'm not sure if this can be fixed easily within pcc as a single reference flag is currently kept.

 Comments   
Comment by Anders Magnusson [ 18/Apr/10 07:09 PM ]
Yes, it's a well-known bug. I'll fix it someday.
Comment by Anders Magnusson [ 01/May/14 04:02 PM ]
This is just a "minor inconvenience" :-)
Generated at Sun Dec 21 14:33:14 CET 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.