An error occurs when a function result is dereferenced if used as another function's argument:
void *func(int num) { static int val; val=num; return (void*)&val; } int main() { printf("%d %d %d\n", *((int*)func(1)), *((int*)func(2)), *((int*)func(3))); return 0; } Output is "1 1 1" instead of "1 2 3". Compiled using "gcc test.c -o test". -- Summary: function result is dereferenced error Product: gcc Version: 3.4.6 Status: UNCONFIRMED Severity: major Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: alexey at cs dot sunysb dot edu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27153