This is the mail archive of the
mailing list for the GCC project.
Pass empty struct in C++ on x86-64 like C?
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GCC Development <gcc at gcc dot gnu dot org>
- Date: Wed, 14 May 2014 12:34:26 -0700
- Subject: Pass empty struct in C++ on x86-64 like C?
- Authentication-results: sourceware.org; auth=none
There is a discrepancy when passing empty struct in C++ on x86-64
between GCC and Clang:
An empty struct of size 1 byte is classified as NO_CLASS.
GCC uses an eight byte slot to pass it on stack and returns it in
EAX while Clang just skips it. Is this possible to pass/return empty
struct for C++ the same way as for C?