fork download
  1. #include <memory.h>
  2. void m()
  3. {
  4. int (*f)() = 0;
  5. int *o=(int*)f;
  6. }
  7.  
  8. void g()
  9. {
  10. int (*f)() = 0;
  11. int *o;
  12. memcpy(&o, &f, sizeof(int*));
  13. }
  14.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘m’:
prog.c:5:8: error: ISO C forbids conversion of function pointer to object pointer type [-Werror=edantic]
prog.c:5:6: error: unused variable ‘o’ [-Werror=unused-variable]
cc1: all warnings being treated as errors
stdout
Standard output is empty