NetBSD Problem Report #50983

From www@NetBSD.org  Sun Mar 20 08:07:36 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id DB62F7ACA7
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 20 Mar 2016 08:07:35 +0000 (UTC)
Message-Id: <20160320080734.C95C37ACB9@mollari.NetBSD.org>
Date: Sun, 20 Mar 2016 08:07:34 +0000 (UTC)
From: davshao@gmail.com
Reply-To: davshao@gmail.com
To: gnats-bugs@NetBSD.org
Subject: stddef.h max_align_t conflicts with pkgsrc firefox
X-Send-Pr-Version: www-1.0

>Number:         50983
>Category:       standards
>Synopsis:       stddef.h max_align_t conflicts with pkgsrc firefox
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mrg
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 20 08:10:00 +0000 2016
>Closed-Date:    Tue Mar 22 17:05:01 +0000 2016
>Last-Modified:  Tue Mar 22 17:05:01 +0000 2016
>Originator:     David Shao
>Release:        
>Organization:
>Environment:
NetBSD xxxxx.xxxxx 7.99.26 NetBSD 7.99.26 (GENERIC) #2: Sat Mar 19 18:56:25 PDT 2016  xxxxx@xxxxx.xxxx:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
The newly added definition in NetBSD 7.99.26 of max_align_t in /usr/include/stddef.h conflicts with pkgsrc firefox:

gcc -o Unified_c_media_libnestegg_src0.o -c -I/usr/pkgsrc/www/firefox/work/build/dist/system_wrappers -include /usr/pkgsrc/www/firefox/work/firefox-45.0.1/config/gcc_hidden.h  -I/usr/pkgsrc/www/firefox/work/firefox-45.0.1/media/libnestegg/src -I.  -I../../../dist/include  -I/usr/pkg/include/nspr -I/usr/pkg/include/nss/nss -I/usr/pkg/include/nss -I/usr/pkg/include/nspr    -I/usr/pkg/include/pixman-1   -fPIC -DPIC  -include ../../../mozilla-config.h -DMOZILLA_CLIENT -MD -MP -MF .deps/Unified_c_media_libnestegg_src0.o.pp -I/usr/include -I/usr/pkg/include -I/usr/pkg/include/nspr -I/usr/pkg/include/nss/nss -I/usr/pkg/include/libdrm -I/usr/pkg/include/freetype2 -Wall -Wempty-body -Wpointer-to-int-cast -Wsign-compare -Wtype-limits -Wno-unused -Wcast-align -O2 -g -I/usr/include -I/usr/pkg/include -I/usr/pkg/include/nspr -I/usr/pkg/include/nss/nss -I/usr/pkg/include/libdrm -I/usr/pkg/include/freetype2 -std=gnu99 -fgnu89-inline -fno-strict-aliasing -Dunix -fno-math-errno -pthread -pipe  -DNDEB
 UG -DTRIMMED -O2 -fomit-frame-pointer     /usr/pkgsrc/www/firefox/work/build/media/libnestegg/src/Unified_c_media_libnestegg_src0.c
In file included from /usr/pkgsrc/www/firefox/work/firefox-45.0.1/media/libnestegg/src/halloc.c:19:0,
                 from /usr/pkgsrc/www/firefox/work/build/media/libnestegg/src/Unified_c_media_libnestegg_src0.c:2:
/usr/pkgsrc/www/firefox/work/firefox-45.0.1/media/libnestegg/src/align.h:42:25: error: conflicting types for 'max_align_t'
 typedef union max_align max_align_t;
                         ^
In file included from /usr/pkgsrc/www/firefox/work/build/dist/system_wrappers/stddef.h:3:0,
                 from /usr/pkgsrc/www/firefox/work/firefox-45.0.1/media/libnestegg/src/halloc.h:18,
                 from /usr/pkgsrc/www/firefox/work/firefox-45.0.1/media/libnestegg/src/halloc.c:18,
                 from /usr/pkgsrc/www/firefox/work/build/media/libnestegg/src/Unified_c_media_libnestegg_src0.c:2:
/usr/include/stddef.h:74:3: note: previous declaration of 'max_align_t' was here
 } max_align_t;


>How-To-Repeat:

>Fix:
I have no idea if this is good practice, but DragonFly BSD 4.5 DEVELOPMENT uses the same guard in its
/usr/include/stddef.h
that gcc seems to from
external/gpl3/gcc/dist/gcc/ginclude/stddef.h

#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
  || (defined(__cplusplus) && __cplusplus >= 201103L)

typedef ... {
...
} max_align_t;

#endif /* C11 or C++11.  */


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: standards-manager->mrg
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Sun, 20 Mar 2016 08:59:52 +0000
Responsible-Changed-Why:
Over to committer of max_align_t


From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: standards-manager@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: re: standards/50983: stddef.h max_align_t conflicts with pkgsrc firefox
Date: Sun, 20 Mar 2016 22:20:57 +1100

 firefox has no right to claim a *_t namespace itself, i think.

 while we could add guards here (and i encourage people to find
 the correct set, which may be the same as DF), i'm pretty sure
 that firefox shouldn't be defining its own *_t symbol.


 .mrg.

From: Kamil Rytarowski <n54@gmx.com>
To: matthew green <mrg@eterna.com.au>, gnats-bugs@NetBSD.org
Cc: 
Subject: Re: standards/50983: stddef.h max_align_t conflicts with pkgsrc
 firefox
Date: Sun, 20 Mar 2016 13:02:11 +0100

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA256

 On 20.03.2016 12:20, matthew green wrote:
 > firefox has no right to claim a *_t namespace itself, i think.
 > 
 > while we could add guards here (and i encourage people to find the
 > correct set, which may be the same as DF), i'm pretty sure that
 > firefox shouldn't be defining its own *_t symbol.
 > 
 > 
 > .mrg.
 > 

  B.2.12 Data Types

 The requirement that additional types defined in this section end in
 "_t" was prompted by the problem of name space pollution. It is
 difficult to define a type (where that type is not one defined by IEEE
 Std 1003.1-2001) in one header file and use it in another without
 adding symbols to the name space of the program. To allow implementors
 to provide their own types, all conforming applications are required
 to avoid symbols ending in "_t", which permits the implementor to
 provide additional types. Because a major use of types is in the
 definition of structure members, which can (and in many cases must) be
 added to the structures defined in IEEE Std 1003.1-2001, the need for
 additional types is compelling.

 http://pubs.opengroup.org/onlinepubs/000095399/xrat/xsh_chap02.html
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2

 iQIcBAEBCAAGBQJW7pFCAAoJEEuzCOmwLnZshdIQAL1L7WrvaiwcnikbU4BQn1PB
 ItqCwt8b9Q4nkwj1Q4Ie/e8JM6aRqTk/JwBT6WapDYovZb4k1Q+0EjwXm/zDaA0X
 WqxkMEVeTf4HFZ6zTxNLvPHVJaLM7TSxBP+/U6/XMdfGpfqBGhdwxTJu/HC9oml5
 rFRiDIMG7lj+mTpsPT3TT/GgYgo7uGnK48TRONRYwgQ0h8GwwsOQFLc+fz9CG4lx
 A6WvrVv/kGCr6nBh9LcGrwyxe3K1Dk/mzlmEVOq9YIGfbi1JxzTqTWEjdB+vVHJ+
 kDsOr7VtRbECD1vr6iZWM5wQTvvsltEcFkKTKl7rp6CiKD39Fz+M2Qw2R+GGMmVe
 RccTTpltpOfhnv4DXD+4pBJTZkEh+X4ZaNpD0NrOXOLDOERp1tdY+JdI/93ZEoVO
 BQVQsPxUKEkEZxE8OLzW/2HEsbpsSxYuI1eafyc5A8clbjlry3X8CToMpkmba0JY
 0e+eJaxq77Zr334julo7m1yMc4l134zFRgfij1/XPYR57DRBKqPc8CDKi2bGlovP
 rEdmhpjIJ/FnGt/KUZ1NO90qi64rWVAjobQr6k6/AJFczTQW6AzTFvs/8Z6sO2yE
 P7xHjSi4oAy8eldUInKt9SeifwNWZWkfPRKGsxUlOU4pW+L85NEc5NXNmGOW56pY
 p1aj/BUNXsAqed5LCapg
 =mTug
 -----END PGP SIGNATURE-----

From: Martin Husemann <martin@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: mrg@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
	davshao@gmail.com
Subject: Re: standards/50983: stddef.h max_align_t conflicts with pkgsrc
 firefox
Date: Sun, 20 Mar 2016 13:35:36 +0000

 On Sun, Mar 20, 2016 at 11:25:01AM +0000, matthew green wrote:
 >  firefox has no right to claim a *_t namespace itself, i think.

 https://bugzilla.mozilla.org/show_bug.cgi?id=1258191

 >  while we could add guards here (and i encourage people to find
 >  the correct set, which may be the same as DF), i'm pretty sure
 >  that firefox shouldn't be defining its own *_t symbol.

 Yes, we should protect it in our headers as well.

 Martin

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50983 CVS commit: src/include
Date: Sun, 20 Mar 2016 10:11:50 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Sun Mar 20 14:11:50 UTC 2016

 Modified Files:
 	src/include: stddef.h

 Log Message:
 PR/50983: David Shao: Protect stddef;
 also make the pointer void *.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.19 src/include/stddef.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Klaus Klein <kleink@kleink.org>
To: matthew green <mrg@eterna.com.au>
Cc: gnats-bugs@NetBSD.org, standards-manager@netbsd.org,
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: standards/50983: stddef.h max_align_t conflicts with pkgsrc
 firefox
Date: Mon, 21 Mar 2016 08:57:20 +0100

 On Sun, Mar 20, 2016 at 10:20:57PM +1100, matthew green wrote:
 > firefox has no right to claim a *_t namespace itself, i think.

 That's right.  The _t suffix is reserved for the implementation
 (in POSIX compilation environments).


 - Klaus

From: David Shao <davshao@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: standards/50983: stddef.h max_align_t conflicts with pkgsrc firefox
Date: Mon, 21 Mar 2016 13:18:12 -0700

 Using current 7.99.26 amd64 through

 Module Name:    src
 Date:           Sun Mar 20 17:31:09 UTC 2016

 Modified Files:
         src/usr.sbin/makemandb: apropos-utils.c

 pkgsrc firefox now builds and installs on both X11_TYPE=native and
 modular.  Thanks!

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 22 Mar 2016 17:05:01 +0000
State-Changed-Why:
fixed, thanks


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.