L
linq936
Hi,
I am having some hard time in reading a code, to me it should not
compile, but it does!
Here are the code structure,
file1.c
#include "common_herders.h"
main(){
if (func1() != 0){
... some stuff ...
}
}
I think this file should not compile because func1() is not declared
before it is called! The definition of func1() is in another file,
file2.c. The compile command is like this,
gcc -O2 file1.c file2.c -o executable.elf \
-Wl,-T -Wl,LinkScr -g -I./include/ -L./lib/
I checked out that "common_heasers.h", there is no declaration of
func1().
Do you see any reason?
I am having some hard time in reading a code, to me it should not
compile, but it does!
Here are the code structure,
file1.c
#include "common_herders.h"
main(){
if (func1() != 0){
... some stuff ...
}
}
I think this file should not compile because func1() is not declared
before it is called! The definition of func1() is in another file,
file2.c. The compile command is like this,
gcc -O2 file1.c file2.c -o executable.elf \
-Wl,-T -Wl,LinkScr -g -I./include/ -L./lib/
I checked out that "common_heasers.h", there is no declaration of
func1().
Do you see any reason?