Issue Details (XML | Word | Printable)

Key: PCC-33
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Gregory McGarry
Votes: 0
Watchers: 0

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

Verification of function arguments not working for function pointers

Created: 14/Feb/09 06:41 AM   Updated: 01/May/14 03:22 PM
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Environment: OS X/i386 10.5

 Description  « Hide
The following code doesn't compile due to an invalid verification of the function arguments. OSX/ppc segfaults on the same code.

typedef int (*MyFunc)(const char *fmt, ...);

print(const char *fmt, ...)

static MyFunc func = (MyFunc)print;

        return func;

        return (*(getFunc()))("%d\n", 10);

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 14/Feb/09 10:27 AM
This has been a problem ~forever, and is difficult to handle. On most places where it shows up I have tried to avoid typechecking.

Anders Magnusson added a comment - 01/May/14 03:22 PM
Seems to have been fixed since bug report.