I have a iOS framework that contains .c
, .mm
source files.
For convenience let's call these two files A.c
and B.mm
.
In both files, I defined a function with the same function protocol like the following.
// A.c
uint32_t get_file(const char *path)
{
...
}
// B.mm
uint32_t get_file(const char *path)
{
...
}
As far as I know, I thought this would throw an error at compile time because there's duplicate symbol, but it successfully compiles the framework without any error. What am I missing here?
Note:
This will be a duplicate symbol
linker error if it was .c
and .m
because Objective-C doesn't undergo name mangling.