https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87392
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Eugeniu Rosca from comment #8) > On 2018-09-25 at 08:53:34 UTC, Jonathan Wakely wrote in comment #6: > > > He already did. Comment 1 quotes the GCC manual which references > > the relevant sections of the standards. > > Comment 1 does indeed reference "(C90 6.3, C99 and C11 6.5)". But if you > check my first post again, you'll see that neither C89->"3.3.7 Bitwise shift > operators" [18] nor its C90 [19] counterpart C90->"6.3.7 Bitwise shift > operators" says a word about signed integers in the definition of the '<<' > operator. This is in contrast with later C standards which supplement the > definition of "E1 << E2" by "If E1 has a signed type ...". It is simply not > possible to conclude from C89->3.3.7 or from C90->6.3.7 that "left-shifting > of signed integer into the sign bit" is implementation-defined behavior. The > C89/C90 sections conveying this message are: > - C89: "A.6.3 Implementation-defined behavior" -> "A.6.3.4 Integers" > - C90: "G.3 Implementation-defined behavior" -> "G.3.5 Integers" But then there is a defect report against C90 which takes exclitly about this: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_081.html So there is still no bug. The C90 and C99 standards differ here and that is plain and simple with that defect report showing their intent for C90 and all.