From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14162 invoked by alias); 11 Jul 2005 14:58:43 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 14145 invoked by uid 22791); 11 Jul 2005 14:58:38 -0000 Received: from nobodaddy.cs.utexas.edu (HELO nobodaddy.cs.utexas.edu) (128.83.120.154) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 11 Jul 2005 14:58:38 +0000 Received: from charco.cs.utexas.edu (njn@charco.cs.utexas.edu [128.83.144.45]) by nobodaddy.cs.utexas.edu (8.13.4/8.13.4) with ESMTP id j6BEwaQU023954 for ; Mon, 11 Jul 2005 09:58:36 -0500 (CDT) Received: (from njn@localhost) by charco.cs.utexas.edu (8.13.4/8.13.4/Submit) id j6BEwaIb020535; Mon, 11 Jul 2005 09:58:36 -0500 Date: Mon, 11 Jul 2005 14:58:00 -0000 From: Nicholas Nethercote To: gcc@gcc.gnu.org Subject: Where does the C standard describe overflow of signed integers? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-SW-Source: 2005-07/txt/msg00412.txt.bz2 Hi, There was recently a very long thread about the overflow behaviour of signed integers in C. Apparently this is undefined according to the C standard. I searched the standard on this matter, and while I did find some paragraphs that described how unsigned integers must wrap around upon overflow, I couldn't find anything explicit about signed integers. Can someone point me to the relevant part(s) of the standard? Also, does anyone know what the required behaviour for Fortran integers is on overflow? (I realise this isn't exactly on-topic for this list, but I thought it reasonable to ask since this topic was discussed so enthusiastically recently :) Thanks very much. Nick