GCC Bugzilla – Bug 27080
gcc should emit .type directives for used undeclared extern variables and functions
Last modified: 2006-04-08 04:06:58 UTC
It doesn't right now, but in a perfect world ld could complain if one object referred to a symbol of type object while another referred to the same symbol of type function.
Of course, in order for ld to do this, gcc would have to actually emit .type directives for extern variables and functions. It doesn't right now, hence this bug.
If we do it for all extern functions and variables, it would be about 1000 .types which are not useful.
I should note people do tricks and one of them would cause an error being emitting, maybe it should maybe not. But even emitting used ones can go up in the .s file size causing more compile time issues.