------- Comment #2 from pinskia at gcc dot gnu dot org  2005-11-21 15:51 -------
(In reply to comment #1)
> Created an attachment (id=10312)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10312&action=view) [edit]
> patch to enable aliasing warnings for C++

Note I think this patch is slightly incorrect as the function
build_reinterpret_cast_1 is called during parsing so you get the warning for
template cases where actually the warning would be incorrect.
An example is:
int b;
template <typename a> a *f(void) {  return (a*)(&b); }

This should not warn if a is int.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24975

Reply via email to