Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22006

Mixing separately compiled objects

$
0
0

Let's I have a class class Drawable. It could have many members, member functions, parent classes, or could be very simple. For the sake of this example that is not important. Also, let's say it is some kind of GUI element.

Then, let's assume I have a rendering engine, which is provided as a GCC library engine.a. That library contains class Screen, which has method void Screen::add(const Drawable & child). All I have are headers and library itself. In my application I instantiate Screen, create few Drawable objects and add them to Screen.

My question:
Could my GCC toolchain (or my GCC toolchain's version) create different memory layout for Drawable objects than in compiled engine.a? Standard does not define it and it is an implementation detail. Either way it will link perfectly. How can I know that and how can I be sure about correct behaviour?

P. S. I mostly use ARM GCC toolchain for Cortex-M architecture. But my question is not limited to that.

P. P. S. If you have any thoughts related, but not related to GCC specifically, please feel free to share.

Thank you.


Viewing all articles
Browse latest Browse all 22006

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>