fork download
  1. #include <stdio.h>
  2.  
  3. int hardcore_abs(int value) {
  4. static void * dummy[] = { &&neg, &&pos };
  5. goto *(&&pos - 3 * (value < 0));
  6. neg:
  7. value = ~value + 1;
  8. pos:
  9. return value;
  10. }
  11.  
  12. int main() {
  13. printf("%d\n", hardcore_abs(42));
  14. printf("%d\n", hardcore_abs(-100500));
  15. return 0;
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘hardcore_abs’:
prog.c:4:19: warning: unused variable ‘dummy’ [-Wunused-variable]
     static void * dummy[] = { &&neg, &&pos };
                   ^
prog.c:3:5: internal compiler error: Segmentation fault
 int hardcore_abs(int value) {
     ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
Preprocessed source stored into /home/1BMiaf/cc7r7jGd.out file, please attach this to your bugreport.
stdout
Standard output is empty