Date: Tue, 28 Jun 2011 23:52:43 -0700 (PDT) From: Alan Larson <larson@w6yx.stanford.edu> To: FreeBSD-gnats-submit@FreeBSD.org Subject: misc/158418: /usr/include librarys broken by unnecessary extra macro indirection. Message-ID: <201106290652.p5T6qhuX020495@w6yx.stanford.edu> Resent-Message-ID: <201106290710.p5T7A6C7053875@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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 <signal.h> 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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106290652.p5T6qhuX020495>