Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Mar 2015 19:45:10 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        freebsd-current@freebsd.org, pjd@FreeBSD.org
Cc:        FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   11.0-CURRENT -r276514: lib/libpjdlog/pjdlog.c has <stdarg.h> after <printf.h>
Message-ID:  <17E1F4C9-EB45-4A14-B3A6-97B016A8AD4D@dsl-only.net>

next in thread | raw e-mail | index | archive | help
Basic context (more details later):

> # freebsd-version -ku; uname -apKU
> 11.0-CURRENT
> 11.0-CURRENT
> FreeBSD FBSDG5C0 11.0-CURRENT FreeBSD 11.0-CURRENT #1 r279514M: Sat =
Mar 21 05:15:23 PDT 2015     =
root@FBSDG5C0:/usr/obj/usr/srcC/sys/GENERIC64vtsc-NODEBUG  powerpc =
powerpc64 1100062 1100062

I was seeing what would happen if I tried gcc5 for =
buildworld/buildkernel and gcc5 reported the following.



The problem:

> /usr/local/bin/gcc5 -fpic -DPIC  -O2 -pipe   -I/usr/srcC/lib/libpjdlog =
-std=3Dgnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -W =
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes =
-Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch =
-Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline =
-Wnested-externs -Wredundant-decls -Wold-style-definition =
-Wno-pointer-sign   -c /usr/srcC/lib/libpjdlog/pjdlog.c -o pjdlog.So

> In file included from /usr/srcC/lib/libpjdlog/pjdlog.c:44:0:
> /usr/include/printf.h:118:44: error: unknown type name 'va_list'
>  int __xvprintf(FILE *fp, const char *fmt0, va_list ap);
>                                             ^

Looking at the sources suggests that <stdarg.h> is explicitly in the =
#include sequence too late to guarantee va_args a definition at the =
point of its use in #include <printf.h> : <stdarg.h> is #include'd in =
pjdlog.c in the line after #include <printf.h> and printf.h itself does =
not (directly) include stdarg.h .

/usr/include/printf.h (the LOOK HERE is my message editing) :
> ...
> #include <stdio.h>
> #include <wchar.h>  /// <<<<< LOOK HERE for lack of <stdarg.h>
> ...
> int __xvprintf(FILE *fp, const char *fmt0, va_list ap);
> ...

/usr/srcC/lib/libpjdlog/pjdlog.c (the LOOK HERE's are my message =
editing) :
> ...
> #include <sys/cdefs.h>
> __FBSDID("$FreeBSD: head/lib/libpjdlog/pjdlog.c 258791 2013-12-01 =
09:41:06Z pjd $");
>=20
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <sys/un.h>
> #include <netinet/in.h>
> #include <arpa/inet.h>
>=20
> #include <assert.h>
> #include <errno.h>
> #include <libutil.h>
> #include <limits.h>
> #include <printf.h>  /// <<<<< LOOK HERE
> #include <stdarg.h>  /// <<<<< LOOK HERE for stdarg.h vs. printf.h =
order
> #include <stdint.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <syslog.h>
> #include <unistd.h>
>=20
> #ifdef notyet
> #include <robustio.h>
> #endif
>=20
> #include "pjdlog.h"



Context details:

make -j 8 \
WITHOUT_CLANG_BOOTSTRAP=3D WITHOUT_CLANG=3D WITHOUT_CLANG_IS_CC=3D \
WITHOUT_LLDB=3D \
WITH_GCC_BOOTSTRAP=3D WITH_GCC=3D WITHOUT_GNUCXX=3D \
WITH_BOOT=3D WITH_LIB32=3D \
buildworld buildkernel \
KERNCONF=3DGENERIC64vtsc-NODEBUG \
TARGET=3Dpowerpc TARGET_ARCH=3Dpowerpc64

# more /etc/src.conf=20
NO_WERROR=3D
WITH_LIBCPLUSPLUS=3D
#
#
# For trying gcc5...
#
CC=3D/usr/local/bin/gcc5
CXX=3D/usr/local/bin/g++5
CPP=3D/usr/local/bin/cpp5
AS=3D/usr/local/powerpc64-portbld-freebsd11.0/bin/as
R=3D/usr/local/powerpc64-portbld-freebsd11.0/bin/ar
LD=3D/usr/local/powerpc64-portbld-freebsd11.0/bin/ld
NM=3D/usr/local/powerpc64-portbld-freebsd11.0/bin/nm
OBJCOPY=3D/usr/local/powerpc64-portbld-freebsd11.0/bin/objcopy
OBJDUMP=3D/usr/local/powerpc64-portbld-freebsd11.0/bin/objdump
RANLIB=3D/usr/local/powerpc64-portbld-freebsd11.0/bin/ranlib
SIZE=3D/usr/local/powerpc64-portbld-freebsd11.0/bin/size
STRINGS=3D/usr/local/powerpc64-portbld-freebsd11.0/bin/strings

# more /etc/make.conf
WRKDIRPREFIX=3D/usr/obj/portswork
#WITH_DEBUG=3D
MALLOC_PRODUCTION=3D

# svnlite info /usr/srcC/
Path: /usr/srcC
Working Copy Root Path: /usr/srcC
URL: https://svn0.us-west.freebsd.org/base/head
Relative URL: ^/head
Repository Root: https://svn0.us-west.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 279514
Node Kind: directory
Schedule: normal
Last Changed Author: adrian
Last Changed Rev: 279514
Last Changed Date: 2015-03-01 18:27:25 -0800 (Sun, 01 Mar 2015)

# svnlite info /usr/ports/lang/gcc5
Path: /usr/ports/lang/gcc5
Working Copy Root Path: /usr/ports
URL: https://svn0.us-west.freebsd.org/ports/head/lang/gcc5
Relative URL: ^/head/lang/gcc5
Repository Root: https://svn0.us-west.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 381120
Node Kind: directory
Schedule: normal
Last Changed Author: gerald
Last Changed Rev: 380943
Last Changed Date: 2015-03-10 10:00:25 -0700 (Tue, 10 Mar 2015)


=3D=3D=3D
Mark Millard
markmi at dsl-only.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?17E1F4C9-EB45-4A14-B3A6-97B016A8AD4D>