[cfe-dev] Compatibility with g++ and VS

Douglas Gregor dgregor at apple.com
Tue Jul 13 07:08:11 PDT 2010

Sent from my iPhone

On Jul 13, 2010, at 3:59 AM, "Martin C. Martin" <martin at martincmartin.com> wrote:

> Hi,
> We're not calling the Clang command line program, but rather hooking 
> into parts of it to JIT compile some code.  We'd like to pass data 
> structures back and forth between the Clang compiled code and the 
> ahead-of-time compiled code, which uses g++ on Linux and VS on Windows.
> So my question is: are classes laid out exactly the same in memory?  If 
> I give the same source to g++/VS and Clang, will the objects have the 
> same fields in the same order with the same padding, same virtual 
> function table, etc. ?

For g++, yes. For VC, we will probably get the same layout for C structs and POD classes, but we don't implement Microsoft's C++ ABI. 

> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list