From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 21 07:16:35 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1B71C16A4CE for ; Fri, 21 Nov 2003 07:16:35 -0800 (PST) Received: from razorbill.mail.pas.earthlink.net (razorbill.mail.pas.earthlink.net [207.217.121.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id DABED43FE5 for ; Fri, 21 Nov 2003 07:16:33 -0800 (PST) (envelope-from richardcoleman@mindspring.com) Received: from titan.criticalmagic.com ([68.213.16.23] helo=mindspring.com) by razorbill.mail.pas.earthlink.net with asmtp (Exim 3.33 #1) id 1AND1M-0006A7-00; Fri, 21 Nov 2003 07:16:32 -0800 Message-ID: <3FBE2C57.6070200@mindspring.com> Date: Fri, 21 Nov 2003 10:16:39 -0500 From: Richard Coleman Organization: Critical Magic, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jay Sern Liew References: <20031120223816.G61303@pinnacle.schulte.org> In-Reply-To: <20031120223816.G61303@pinnacle.schulte.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: 1ee258965991efcb0865379cdb43356e5e89bb4777695beb702e37df12b9c9ef67d076f66eb4ed2e5a50595281111ef7350badd9bab72f9c350badd9bab72f9c cc: freebsd-hackers@freebsd.org Subject: Re: integer and long max/min values X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: richardcoleman@mindspring.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2003 15:16:35 -0000 Jay Sern Liew wrote: > how do I find out the maximum (and minimum) value a long and int will hold > in C? (before it overflows or underflows) > > if it's compiler-dependent, then does anyone know where I can find the GCC > documentation for stuff like that? It will be architecture dependent (32 or 64 bit machines?). I doubt the GCC docs talk about this. You might check Richard Steven's book on "Advanced Unix Programming". It covers lots of information about standard machine limits and how to discover them. Richard Coleman richardcoleman@mindspring.com