public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c/37249] New: gcc does not warn on trucate of int64_t to int32_t @ 2008-08-27 2:07 sean dot c dot rhea at gmail dot com 2008-08-27 2:35 ` [Bug c/37249] " pinskia at gcc dot gnu dot org 2008-08-27 16:49 ` manu at gcc dot gnu dot org 0 siblings, 2 replies; 3+ messages in thread From: sean dot c dot rhea at gmail dot com @ 2008-08-27 2:07 UTC (permalink / raw) To: gcc-bugs This bug is related to bug 2707. I think the following code should generate a warning: int64_t i = 9223372036854775807ll; int32_t j = i; It does not generate any warnings with "gcc-4.2.1 -Wall -Wextra". -- Summary: gcc does not warn on trucate of int64_t to int32_t Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sean dot c dot rhea at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37249 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/37249] gcc does not warn on trucate of int64_t to int32_t 2008-08-27 2:07 [Bug c/37249] New: gcc does not warn on trucate of int64_t to int32_t sean dot c dot rhea at gmail dot com @ 2008-08-27 2:35 ` pinskia at gcc dot gnu dot org 2008-08-27 16:49 ` manu at gcc dot gnu dot org 1 sibling, 0 replies; 3+ messages in thread From: pinskia at gcc dot gnu dot org @ 2008-08-27 2:35 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from pinskia at gcc dot gnu dot org 2008-08-27 02:34 ------- try -Wconversion, which works like what you want it to work in 4.3 and above. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37249 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/37249] gcc does not warn on trucate of int64_t to int32_t 2008-08-27 2:07 [Bug c/37249] New: gcc does not warn on trucate of int64_t to int32_t sean dot c dot rhea at gmail dot com 2008-08-27 2:35 ` [Bug c/37249] " pinskia at gcc dot gnu dot org @ 2008-08-27 16:49 ` manu at gcc dot gnu dot org 1 sibling, 0 replies; 3+ messages in thread From: manu at gcc dot gnu dot org @ 2008-08-27 16:49 UTC (permalink / raw) To: gcc-bugs [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 546 bytes --] ------- Comment #2 from manu at gcc dot gnu dot org 2008-08-27 16:48 ------- pr37249.c:4: warning: conversion to int32_t from int64_t may alter its value [-Wconversion] Fixed in GCC 4.3, 4.4 -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37249 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-27 16:49 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-08-27 2:07 [Bug c/37249] New: gcc does not warn on trucate of int64_t to int32_t sean dot c dot rhea at gmail dot com 2008-08-27 2:35 ` [Bug c/37249] " pinskia at gcc dot gnu dot org 2008-08-27 16:49 ` manu at gcc dot gnu dot org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).