Issue Details (XML | Word | Printable)

Key: PCC-123
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Iain Hibbert
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

static inline functions need reference counting rather than just reference noting

Created: 04/Apr/10 10:02 PM   Updated: 01/May/14 04:02 PM
Component/s: pcc backend
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD


 Description  « Hide
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.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 18/Apr/10 07:09 PM
Yes, it's a well-known bug. I'll fix it someday.

Anders Magnusson added a comment - 01/May/14 04:02 PM
This is just a "minor inconvenience" :-)