misc/158418: /usr/include librarys broken by unnecessary extra macro indirection.

Alan Larson larson at w6yx.stanford.edu
Wed Jun 29 07:10:06 UTC 2011

>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
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 29 07:10:05 UTC 2011
>Originator:     Alan Larson
>Release:        FreeBSD 8.2-STABLE i386
not relevant to this report
System: FreeBSD w6yx.stanford.edu 8.2-STABLE FreeBSD 8.2-STABLE #0: Tue May 3 15:19:30 PDT 2011 techie at w.wbopera.holt:/w0/obj/usr/src/sys/GENERIC i386

  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 )

  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.


  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
        But seriously, you should take solution #1.


More information about the freebsd-bugs mailing list