This is the mail archive of the gcc-bugs@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]

[Bug sanitizer/63806] #UBSAN ignores signed char possible overflow


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
?  That is the correct thing to do, there is no undefined behavior in C/C++ in
that testcase, for any a/b values.
a + b in C is computed on promoted arguments, so (signed char) ((int) a + (int)
b) in this case, so as long as signed char is narrower than int, it is fine.


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