R
Rahul
Hi Everyone,
I have the following code,
file1.cpp
---------
#include <cstdio>
inline int sample1()
{
printf("1::sample1\n");
return(0);
}
int main()
{
sample1();
return(0);
}
file2.cpp
---------
#include <cstdio>
int sample1()
{
printf("2::sample1\n");
return(0);
}
when i build both the files and exeucte, i get the following output,
2::sample1
I expected a linker error, as file2.o is exporting sample1 which is
already available in file1.o... What does the standard indicate for
such scenarios?
Thanks in advance !!!
I have the following code,
file1.cpp
---------
#include <cstdio>
inline int sample1()
{
printf("1::sample1\n");
return(0);
}
int main()
{
sample1();
return(0);
}
file2.cpp
---------
#include <cstdio>
int sample1()
{
printf("2::sample1\n");
return(0);
}
when i build both the files and exeucte, i get the following output,
2::sample1
I expected a linker error, as file2.o is exporting sample1 which is
already available in file1.o... What does the standard indicate for
such scenarios?
Thanks in advance !!!