From owner-freebsd-amd64@FreeBSD.ORG Tue Aug 31 23:00:13 2010 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED9C710656B7 for ; Tue, 31 Aug 2010 23:00:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AD6A48FC19 for ; Tue, 31 Aug 2010 23:00:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o7VN0DA4006343 for ; Tue, 31 Aug 2010 23:00:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7VN0DA0006337; Tue, 31 Aug 2010 23:00:13 GMT (envelope-from gnats) Resent-Date: Tue, 31 Aug 2010 23:00:13 GMT Resent-Message-Id: <201008312300.o7VN0DA0006337@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Gerald Pfeifer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 697B610656BB for ; Tue, 31 Aug 2010 22:52:31 +0000 (UTC) (envelope-from pfeifer@sputnik1.dbai.tuwien.ac.at) Received: from sputnik1.dbai.tuwien.ac.at (sputnik1.dbai.tuwien.ac.at [128.131.111.141]) by mx1.freebsd.org (Postfix) with ESMTP id 001C68FC1F for ; Tue, 31 Aug 2010 22:52:30 +0000 (UTC) Received: from sputnik1.dbai.tuwien.ac.at (localhost [127.0.0.1]) by sputnik1.dbai.tuwien.ac.at (8.14.4/8.14.4) with ESMTP id o7VMW2a3028336; Wed, 1 Sep 2010 00:32:02 +0200 (CEST) (envelope-from pfeifer@sputnik1.dbai.tuwien.ac.at) Received: (from pfeifer@localhost) by sputnik1.dbai.tuwien.ac.at (8.14.4/8.14.4/Submit) id o7VMW1MX028335; Wed, 1 Sep 2010 00:32:01 +0200 (CEST) (envelope-from pfeifer) Message-Id: <201008312232.o7VMW1MX028335@sputnik1.dbai.tuwien.ac.at> Date: Wed, 1 Sep 2010 00:32:01 +0200 (CEST) From: Gerald Pfeifer To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 X-Mailman-Approved-At: Tue, 31 Aug 2010 23:01:36 +0000 Cc: Subject: amd64/150170: SIG_ATOMIC_MIN/SIG_ATOMIC_MAX 32-bit when sig_atomic_t is 64-bit X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Gerald Pfeifer List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2010 23:00:14 -0000 >Number: 150170 >Category: amd64 >Synopsis: SIG_ATOMIC_MIN/SIG_ATOMIC_MAX 32-bit when sig_atomic_t is 64-bit >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 31 23:00:13 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Gerald Pfeifer >Release: FreeBSD 8.0-CURRENT amd64 >Organization: >Environment: System: FreeBSD ref9-amd64.freebsd.org 9.0-CURRENT FreeBSD 9.0-CURRENT #4 r208973: Thu Jun 10 08:49:43 UTC 2010 simon@ref9-amd64.freebsd.org:/scratch/obj/usr/src/sys/REF9-AMD64 amd64 >Description: On a 9.0-CURRENT machine, amd64, we have: /usr/include/machine/signal.h:typedef long sig_atomic_t; This is 32-bit. At the same time we have: /usr/include/machine/_stdint.h:#define SIG_ATOMIC_MIN INT32_MIN /usr/include/machine/_stdint.h:#define SIG_ATOMIC_MAX INT32_MAX Which is 64-bit. >How-To-Repeat: Run GCC's C testsuite and notice a number of C conformance tests around stdint fail: FAIL: gcc.dg/c99-stdint-1.c (test for excess errors) FAIL: gcc.dg/c99-stdint-2.c (test for excess errors) FAIL: gcc.dg/c99-stdint-5.c (test for excess errors) FAIL: gcc.dg/c99-stdint-6.c (test for excess errors) >Fix: Initially I thought we may want to adjust SIG_ATOMIC_MIN and SIG_ATOMIC_MAX, but really, who need sig_atomic_t to be 64-bit? (Linux does not, for what it's worth.) In any case, having a type that is larger than the values it can take like this is something we should be able to avoid. At a minimum it's inconsistent. >Release-Note: >Audit-Trail: >Unformatted: