This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] [PR 13005] Warn about casting of incomplete types


On Sat, Jan 10, 2004 at 07:31:20AM +0000, Nathan Sidwell wrote:
> I think it should only warn about casting from/to ptr/ref to
> an incomplete type from/to a ptr/ref to another class type. Otherwise there
> is no way to silence false positives, and (void *)ptr is ok anyway.

Good catch on the void* case.  My initial version used a
POINTER_TYPE_P check, much as you suggested (not quite, but close).
It was uglier than the 3-liner I eventually posted, mostly because of
the reference squashing elsewhere in build_c_cast(), but it worked.  I
have no idea why I forgot the void* case after switching to the
3-liner. 

Thanks for looking at the patch, and extra thanks for catching the
void* bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]