From owner-freebsd-current@FreeBSD.ORG Sun Mar 22 12:15:14 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8834DEBD; Sun, 22 Mar 2015 12:15:14 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40EA094F; Sun, 22 Mar 2015 12:15:14 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::8b7:b034:6f55:4291] (unknown [IPv6:2001:7b8:3a7:0:8b7:b034:6f55:4291]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 66A895C4C; Sun, 22 Mar 2015 13:15:07 +0100 (CET) Subject: Re: 11.0-CURRENT -r276514: lib/libpjdlog/pjdlog.c has after Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_E5F2705D-23D7-4A2F-932D-D99A3F009B22"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b6 From: Dimitry Andric In-Reply-To: <17E1F4C9-EB45-4A14-B3A6-97B016A8AD4D@dsl-only.net> Date: Sun, 22 Mar 2015 13:14:54 +0100 Message-Id: References: <17E1F4C9-EB45-4A14-B3A6-97B016A8AD4D@dsl-only.net> To: Mark Millard X-Mailer: Apple Mail (2.2070.6) Cc: freebsd-current@freebsd.org, FreeBSD PowerPC ML X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2015 12:15:14 -0000 --Apple-Mail=_E5F2705D-23D7-4A2F-932D-D99A3F009B22 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 22 Mar 2015, at 03:45, Mark Millard wrote: ... > Looking at the sources suggests that is explicitly in the = #include sequence too late to guarantee va_args a definition at the = point of its use in #include : is #include'd in = pjdlog.c in the line after #include and printf.h itself does = not (directly) include stdarg.h . >=20 > /usr/include/printf.h (the LOOK HERE is my message editing) : >> ... >> #include >> #include /// <<<<< LOOK HERE for lack of >> ... >> int __xvprintf(FILE *fp, const char *fmt0, va_list ap); >> ... >=20 > /usr/srcC/lib/libpjdlog/pjdlog.c (the LOOK HERE's are my message = editing) : >> ... >> #include >> __FBSDID("$FreeBSD: head/lib/libpjdlog/pjdlog.c 258791 2013-12-01 = 09:41:06Z pjd $"); >>=20 >> #include >> #include >> #include >> #include >> #include >>=20 >> #include >> #include >> #include >> #include >> #include /// <<<<< LOOK HERE >> #include /// <<<<< LOOK HERE for stdarg.h vs. printf.h = order You should be able to include standard headers (or at least, headers in /usr/include) in any order, and includes , which then defines the correct types. However, there is a problem in the gcc ports. What happens, is that the gcc port uses its *own* munged versions of stdio.h and stdarg.h, and includes them instead of the system versions. For example, the gcc 4.7 port has this "fixed" version of stdio.h: = /usr/local/lib/gcc47/gcc/i386-portbld-freebsd11.0/4.7.4/include-fixed/stdi= o.h which explicitly *disables* our declaration of __va_list (the type which va_list is based on): typedef __va_list __not_va_list__; For functions like vprintf(), it replaces __va_list by a GNU builtin variant, for example: int vprintf(const char * __restrict, __gnuc_va_list); However, it does not properly declare the regular va_list type, and then things break in interesting ways. I think the ports should not attempt to "fix" our include files. -Dimitry --Apple-Mail=_E5F2705D-23D7-4A2F-932D-D99A3F009B22 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.27 iEYEARECAAYFAlUOskkACgkQsF6jCi4glqNKewCg5UFKQELcuZRPLKJbKKHaTTqP Td0An1cgQwTBawPobYLzpJ1dWwPfqTsZ =OGfx -----END PGP SIGNATURE----- --Apple-Mail=_E5F2705D-23D7-4A2F-932D-D99A3F009B22--