public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54895] New: the compiler treats '__cdecl' & '__stdcall' as the same.
@ 2012-10-10 19:52 i.nixman at gmail dot com
  2012-10-10 19:54 ` [Bug c++/54895] " i.nixman at gmail dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: i.nixman at gmail dot com @ 2012-10-10 19:52 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54895

             Bug #: 54895
           Summary: the compiler treats '__cdecl' & '__stdcall' as the
                    same.
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: i.nixman@gmail.com


When I compile this simple code:
void myfoo(void(__cdecl*)()){}
void myfoo(void(__stdcall*)()){}
int main(){}


I get the following error:
Assembler messages:
Error: symbol `__Z5myfooPFvvE' is already defined

Why the compiler treats theese two specificators as the same?


Another example code work as expected:
template<typename T, typename U>
struct is_same {
        enum { value = 0 };
};

template<typename T>
struct is_same<T, T> {
        enum { value = 1 };
};

int main() {
        typedef void(__stdcall* stdcall_func_ptr)();
        typedef void(__cdecl* cdecl_func_ptr)();

        return is_same<stdcall_func_ptr, cdecl_func_ptr>::value;
}

main returns 0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-09-22 10:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-10 19:52 [Bug c++/54895] New: the compiler treats '__cdecl' & '__stdcall' as the same i.nixman at gmail dot com
2012-10-10 19:54 ` [Bug c++/54895] " i.nixman at gmail dot com
2012-10-10 20:17 ` sezeroz at gmail dot com
2012-10-10 20:53 ` [Bug target/54895] " glisse at gcc dot gnu.org
2012-11-22 11:47 ` ktietz at gcc dot gnu.org
2012-11-22 18:38 ` i.nixman at gmail dot com
2012-11-22 18:48 ` ktietz at gcc dot gnu.org
2012-11-22 18:55 ` [Bug c++/54895] " ktietz at gcc dot gnu.org
2012-11-22 19:08 ` paolo.carlini at oracle dot com
2012-11-22 19:11 ` ktietz at gcc dot gnu.org
2012-11-22 19:14 ` paolo.carlini at oracle dot com
2012-11-22 19:16 ` ktietz at gcc dot gnu.org
2015-09-22 10:33 ` ktietz at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).