From owner-freebsd-hackers@FreeBSD.ORG Thu May 1 08:07:15 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 D366437B408 for ; Thu, 1 May 2003 08:07:15 -0700 (PDT) Received: from gw.nectar.cc (gw.nectar.cc [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id D72D843FBF for ; Thu, 1 May 2003 08:07:14 -0700 (PDT) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.nectar.cc (Postfix) with ESMTP id 5110AB4; Thu, 1 May 2003 10:07:14 -0500 (CDT) Received: by madman.celabo.org (Postfix, from userid 1001) id 9D43E78C4A; Thu, 1 May 2003 10:07:13 -0500 (CDT) Date: Thu, 1 May 2003 10:07:13 -0500 From: "Jacques A. Vidrine" To: Dag-Erling Smorgrav Message-ID: <20030501150713.GA34992@madman.celabo.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.3i-ja.1 cc: hackers@freebsd.org Subject: Re: incorrect enum warning? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 15:07:16 -0000 On Thu, May 01, 2003 at 04:51:40PM +0200, Dag-Erling Smorgrav wrote: > Why does the following code in OpenPAM headers: > > /* > * XSSO 5.4 > */ > enum { > PAM_SILENT = 0x80000000, > PAM_DISALLOW_NULL_AUTHTOK = 0x1, > PAM_ESTABLISH_CRED = 0x1, > PAM_DELETE_CRED = 0x2, > PAM_REINITIALIZE_CRED = 0x4, > PAM_REFRESH_CRED = 0x8, > PAM_PRELIM_CHECK = 0x1, > PAM_UPDATE_AUTHTOK = 0x2, > PAM_CHANGE_EXPIRED_AUTHTOK = 0x4 > }; > > cause the following warning when compiled with CSTD=c99: > > /usr/src/contrib/openpam/include/security/pam_constants.h:100: warning: ISO C restricts enumerator values to range of `int' > > when 0x80000000 is clearly within the range of 'int' on all platforms > we support? Guessing: C does not specify one's complement or two's complement representation of integers. On a one's complement 32-bit platform, 0x80000000 is -0 (negative zero), which cannot be an `int'. Cheers, -- Jacques Vidrine . NTT/Verio SME . FreeBSD UNIX . Heimdal nectar@celabo.org . jvidrine@verio.net . nectar@freebsd.org . nectar@kth.se