Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Calling a C Function without Prototype
- void foo(const char *name) {
- printf("foo called with %sn", name);
- }
- void bar(int a) {
- printf("bar called with %dn", a);
- }
- int main(int argc, char *argv[]) {
- foo("Hello");
- bar(5);
- return 0;
- }
- gcc -fno-builtin -ansi -c -o foo.o foo.c
- gcc -fno-builtin -ansi -c -o bar.o bar.c
- gcc -fno-builtin -ansi -c -o main.o main.c
- gcc -o progy main.o bar.o foo.o
- 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