From owner-freebsd-bugs@FreeBSD.ORG Wed Jun 29 07:10:06 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C70C1065670 for ; Wed, 29 Jun 2011 07:10:06 +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 58E2C8FC0A for ; Wed, 29 Jun 2011 07:10:06 +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 p5T7A6OB053876 for ; Wed, 29 Jun 2011 07:10:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p5T7A6C7053875; Wed, 29 Jun 2011 07:10:06 GMT (envelope-from gnats) Resent-Date: Wed, 29 Jun 2011 07:10:06 GMT Resent-Message-Id: <201106290710.p5T7A6C7053875@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alan Larson Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C268C106566B for ; Wed, 29 Jun 2011 07:09:08 +0000 (UTC) (envelope-from larson@w6yx.stanford.edu) Received: from smtp.stanford.edu (smtp4.Stanford.EDU [171.67.219.84]) by mx1.freebsd.org (Postfix) with ESMTP id A980A8FC14 for ; Wed, 29 Jun 2011 07:09:08 +0000 (UTC) Received: from smtp.stanford.edu (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id 6D8941A5465 for ; Tue, 28 Jun 2011 23:52:49 -0700 (PDT) Received: from w6yx.stanford.edu (w6yx.Stanford.EDU [171.67.193.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.stanford.edu (Postfix) with ESMTPS id 1ABAC1A55A7 for ; Tue, 28 Jun 2011 23:52:49 -0700 (PDT) Received: from w6yx.stanford.edu (localhost [127.0.0.1]) by w6yx.stanford.edu (8.14.4/8.14.4) with ESMTP id p5T6qhEU020496 for ; Tue, 28 Jun 2011 23:52:48 -0700 (PDT) (envelope-from larson@w6yx.stanford.edu) Received: (from larson@localhost) by w6yx.stanford.edu (8.14.4/8.14.4/Submit) id p5T6qhuX020495; Tue, 28 Jun 2011 23:52:43 -0700 (PDT) (envelope-from larson) Message-Id: <201106290652.p5T6qhuX020495@w6yx.stanford.edu> Date: Tue, 28 Jun 2011 23:52:43 -0700 (PDT) From: Alan Larson To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: misc/158418: /usr/include librarys broken by unnecessary extra macro indirection. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alan Larson List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2011 07:10:06 -0000 >Number: 158418 >Category: misc >Synopsis: /usr/include librarys broken by unnecessary extra macro indirection. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 29 07:10:05 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Alan Larson >Release: FreeBSD 8.2-STABLE i386 >Organization: not relevant to this report >Environment: System: FreeBSD w6yx.stanford.edu 8.2-STABLE FreeBSD 8.2-STABLE #0: Tue May 3 15:19:30 PDT 2011 techie@w.wbopera.holt:/w0/obj/usr/src/sys/GENERIC i386 >Description: The macro __aligned(x) is used several places in files in /usr/include, but is only defined if using a sufficiently new version of GCC, or an Intel compiler. The definitions are inside an #if __GNUC_PREREQ__(2, 7) and #if defined(__INTEL_COMPILER) This breaks things when compiled with PCC or TCC. ( http://pcc.ludd.ltu.se/jira/browse/PCC-18 ) >How-To-Repeat: Attempt to compile something that has an #include with TCC (or presumably, PCC). Inspection of the code indicates that the same problem is true for __packed . Other values are also redefined in those same conditionals, and they probably have the same problems. >Fix: Two likely fixes come to mind: 1. Don't use these macro shortcuts, use the __attribute__ form directly. Many of the files in /usr/include do this, so fixing the remaining ones would simplify things. It should only take a few minutes to fix them. There are still lots of places using the __attribute__ form, so this is a proven safe and reasonable solution. 2. If you absolutely must include macros for this, define the macro all the time. But seriously, you should take solution #1. >Release-Note: >Audit-Trail: >Unformatted: