------- Comment #4 from pinskia at gcc dot gnu dot org  2009-03-24 07:28 -------
(In reply to comment #3)
> g++.old-deja/g++.pt/t39.C: It looks like ptr[0],[1],[2] are either int or 
> const
> char (i.e. ptr is int* or const char*). %p doesn't make much sense in those
> cases, so I opted for a cast.

Woops I needed to look at the testcase closer.  Yes casting to int here is
correct.


> I'm not sure I followed your last sentence; I realize that many people find 
> the
> Ubuntu default compiler flags inappropriate, but I'm hoping that can be set
> aside in the interests of helping to improve our ability to compare testsuite
> output.  As you say, many of the changes are correct, and the rest have no
> negative impact.

What I am saying is that those testcase does not need to change as the
undefined behavior is not invoked so the warning does not matter, which case
Ubuntu's default compiler flags are very inappropriate.  Remember undefined
behavior at runtime cannot cause a diagnostic by default according to the C/C++
standard and this is only undefined behavior at runtime.


-- 


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

Reply via email to