------- Comment #6 from regehr at cs dot utah dot edu 2010-07-06 14:10 ------- (In reply to comment #2) > Not sure whether the testcase is valid or not. The multiplication using char > variables on both sides (and likewise for result) is: -54 * -56 (= 3024), > but (char) 3024 is -48. For int that would be clear undefined behavior, but > for char the multiplication is promoted to int, so it is (char) (int * int).
My students and I had to argue about this and read the standard before submitting this bug report. But I'm almost certain the testcase is valid. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44828