Type cast to function pointer doesn't work
Open
area:compiler
kind:bug
status:help-wanted
- Dominant language
- C#
- Stars
- 451
- Forks
- 49
- Avg merge
- 13h 59m
- Merged PRs (30d)
- 6
Description
See a comment in `Cesium.IntegrationTests/type_casts.c` (introduced in #377):
```
// function pointer types are not supported yet?
// int j = (int) (void (*)(int a)) a;
// int k = (int) (void (*)(int a)) (a + b);
// if (j + k != 5) return -5;
```
We should investigate this problem.
Contributor guide
Research direction
Start with the commented examples in Cesium.IntegrationTests/type_casts.c and review the context from #377. Reproduce the function-pointer casts, determine whether the compiler rejects or mishandles them, and consider the work complete when the behavior is understood and the examples have appropriate passing coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, csharp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100