Guest User

Untitled

a guest
Aug 17th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. Calling a C Function without Prototype
  2. void foo(const char *name) {
  3. printf("foo called with %sn", name);
  4. }
  5.  
  6. void bar(int a) {
  7. printf("bar called with %dn", a);
  8. }
  9.  
  10. int main(int argc, char *argv[]) {
  11. foo("Hello");
  12. bar(5);
  13. return 0;
  14. }
  15.  
  16. gcc -fno-builtin -ansi -c -o foo.o foo.c
  17. gcc -fno-builtin -ansi -c -o bar.o bar.c
  18. gcc -fno-builtin -ansi -c -o main.o main.c
  19.  
  20. gcc -o progy main.o bar.o foo.o
  21.  
  22. ld -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o progy /usr/lib64/crt1.o /usr/lib64/crti.o /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/crtbegin.o main.o foo.o bar.o -lc -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1 -lgcc -lgcc_s /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/crtend.o /usr/lib64/crtn.o
Add Comment
Please, Sign In to add comment