From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6123 invoked by alias); 1 Apr 2008 19:35:10 -0000 Received: (qmail 5638 invoked by uid 48); 1 Apr 2008 19:34:27 -0000 Date: Tue, 01 Apr 2008 19:35:00 -0000 Message-ID: <20080401193427.5637.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/35592] Want attribute to enable precision loss warning In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "felix-gcc at fefe dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg00099.txt.bz2 ------- Comment #6 from felix-gcc at fefe dot de 2008-04-01 19:34 ------- Sure. For example: char* c=malloc(lseek(somefd,0,SEEK_END); on a platform where off_t is 64-bit, but where size_t is 32-bit. For example: i686-linux with #define _FILE_OFFSET_BITS 64. Now that I'm thinking about it, would it be possible to have a generic overflow warning in that context? For example, malloc(p->len+1) So that gcc sees I'm adding something there, and if the range is not clamped down before that gives an error? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35592