https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66424

--- Comment #4 from Zhendong Su <su at cs dot ucdavis.edu> ---
(In reply to jos...@codesourcery.com from comment #3)
> See C11 6.5.2.2#6 regarding when calls to unprototyped functions involve 
> undefined behavior.  Being able to represent the value is only relevant 
> where the case is a mismatch of corresponding signed/unsigned types.

Joseph, thank you for the clarification. I assume that you were referring to
the following passage of C11 6.5.2.2 #6: 

"If the function is defined with a type that does not include a prototype, and
the types of the arguments after promotion are not compatible with those of the
parameters after promotion, the behavior is undefined, except for the following
cases ... "

Since int and long long are incompatible, thus the test case's behavior is
undefined. Correct? 

If I may ask a follow-up question: How GCC treats the test case seems to have
changed from 4.9 to 5.1. What might have prompted the change as the 4.9
behavior to me seems more natural and user-friendly (and is also how clang
behaves)?  

Thank you.

Reply via email to