[Q] Impact of Unseen Types
From: Garvin, Michael [CAR:C28G:EXCH] (mgarvin_at_americasm01.nt.com)
Date: Mon, 18 Oct 2004 15:55:50 -0400
Hi I'm working on some impact analysis stuff for C++. I was wondering if
anyone has seen an example of a type (lets say type "A") change impacting
the storage/layout another type (lets say type "B"), but B does not include
the header/src file where A is defined.
Also B is using type A by more than just a pointer, that is B needs to know
the size/layout of A.
For most (all?) complex types, I presume that the compiler must see the full
declaration of the type its using, in order to know the size, alignment,
layout etc. Is there any sneaky way around this, that I might have to
account for when trying to find the impact of a changed type?
Another way to ask this question; if I know exactly which header file type A
is defined in, and I know that type A has changed in size/layout, can I
assume that only the files which include type A's header are candidate
users? ...the places where some other type might possibly use type A
It sounds like a reasonable assumption, but there are lots of sneaky things
that can be done in C++. :( Maybe there is a way around this assumption?
Thanks in advance for any tips or examples that you've encountered...