Advertisement
alansam

Compile an empty file.

Aug 11th, 2021
1,579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.13 KB | None | 0 0
  1. $ export d="=========="
  2. $ echo $d$d$d$d$d$d$d$d
  3. ================================================================================
  4. $ touch empty.c
  5. $ file empty.c
  6. empty.c: empty
  7. $ echo $d$d$d$d$d$d$d$d
  8. ================================================================================
  9. $ clang -Wall -pedantic empty.c
  10. empty.c:1:1: warning: ISO C requires a translation unit to contain at least one declaration [-Wempty-translation-unit]
  11. 1 warning generated.
  12. Undefined symbols for architecture x86_64:
  13.   "_main", referenced from:
  14.      implicit entry/start for main executable
  15. ld: symbol(s) not found for architecture x86_64
  16. clang: error: linker command failed with exit code 1 (use -v to see invocation)
  17. $ echo $d$d$d$d$d$d$d$d
  18. ================================================================================
  19. $ gcc-11 -Wall -pedantic empty.c
  20. empty.c:2: warning: ISO C forbids an empty translation unit [-Wpedantic]
  21. Undefined symbols for architecture x86_64:
  22.   "_main", referenced from:
  23.      implicit entry/start for main executable
  24. ld: symbol(s) not found for architecture x86_64
  25. collect2: error: ld returned 1 exit status
  26. $ unset d
  27. $
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement