<< Back to previous view

[PCC-33] Verification of function arguments not working for function pointers Created: 14/Feb/09  Updated: 01/May/14

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

Type: Bug Priority: Major
Reporter: Gregory McGarry Assignee: Anders Magnusson
Resolution: Cannot Reproduce Votes: 0
Environment: OS X/i386 10.5


 Description   
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, ...);

int
print(const char *fmt, ...)
{
}

static MyFunc func = (MyFunc)print;

MyFunc
getFunc(void)
{
        return func;
}

int
main(void)
{
        return (*(getFunc()))("%d\n", 10);
}




 Comments   
Comment by Anders Magnusson [ 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.
Comment by Anders Magnusson [ 01/May/14 03:22 PM ]
Seems to have been fixed since bug report.
Generated at Mon Sep 01 23:10:46 CEST 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.