This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
function signature different in .o file!
- To: gcc-bugs at gcc dot gnu dot org
- Subject: function signature different in .o file!
- From: Amit Mehrotra <amehrotr at mail dot icims dot csl dot uiuc dot edu>
- Date: Mon, 24 Jan 2000 18:31:50 -0600
- Organization: Coordinated Science Lab UIUC
I think this is a bug in g++. I have a function called
setCurrentControlledSourceControllingBranchCurrent ( /* some definition
*/)
I do a forward declaration of that, use it and later define it (all in
the same .cc file). The file compiles without an error but at link time,
ld says that the function is undefined. I did an nm on the .o file and
grepped for this functions and I find the signatures of the two
instances of this functions are different. Here are two signatures:
If the signatures of the definition and the point of use were indeed
different (they are not in my .cc code), the .cc file should not have
compiled in the first place!
998: U
setCurrentControlledSourceControllingBranchCurrent__FR7CircuitRCt8hash_map5Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0ZiZ25anotherStringHashFunctionZt8equal_to1Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt9allocator1ZiRCt8hash_map5ZiZt6vector2Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt9allocator1Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt4hash1ZiZt8equal_to1ZiZt9allocator1Zt6vector2Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt9allocator1Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Rt6vector2Z5IndexZt9allocator1Z5Index
999:00033104 T
setCurrentControlledSourceControllingBranchCurrent__FR7CircuitRCt8hash_map5Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0ZiZ25anotherStringHashFunctionZt8equal_to1Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt9allocator1ZiRt8hash_map5ZiZt6vector2Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt9allocator1Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt4hash1ZiZt8equal_to1ZiZt9allocator1Zt6vector2Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt9allocator1Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Rt6vector2Z5IndexZt9allocator1Z5Index
Amit