Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jun 2018 16:08:16 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        mmacy@FreeBSD.org, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   head -r334749 breaks the FreeBSD-head-amd64-gcc ci.freebsd.org build [via pmc.h struct's having constructors in C++]
Message-ID:  <F5A2B204-90CC-450C-9C0D-105934714FB0@yahoo.com>

next in thread | raw e-mail | index | archive | help
[Note other build failures stopped builds before the below before
this was run into. Now those pass to reach the below.]

ci.free.bsd.org has FreeBSD-head-amd64-gcc failing for:

--- libpmc_json.o ---
In file included from /workspace/src/lib/libpmc/libpmc_json.cc:39:0:
/workspace/src/lib/libpmc/pmc.h:102:53: error: 'int pmc_cpuinfo(const =
pmc_cpuinfo**)' hides constructor for 'struct pmc_cpuinfo' =
[-Werror=3Dshadow]
 int pmc_cpuinfo(const struct pmc_cpuinfo **_cpu_info);
                                                     ^
/workspace/src/lib/libpmc/pmc.h:103:57: error: 'int pmc_pmcinfo(int, =
pmc_pmcinfo**)' hides constructor for 'struct pmc_pmcinfo' =
[-Werror=3Dshadow]
 int pmc_pmcinfo(int _cpu, struct pmc_pmcinfo **_pmc_info);
                                                         ^



With the .cc (so C++ context) the name of a struct is also the name
of the constructor for the struct. Having subroutines with that name
name ends up with the name shadowing the C++ constructor.

The builds are set up to reject such.

The struct's in pmc.h are:

struct pmc_cpuinfo {
	enum pmc_cputype pm_cputype;	/* the kind of CPU */
	uint32_t	pm_ncpu;	/* number of CPUs */
	uint32_t	pm_npmc;	/* #PMCs per CPU */
	uint32_t	pm_nclass;	/* #classes of PMCs */
	struct pmc_classinfo pm_classes[PMC_CLASS_MAX];
};

and:

struct pmc_pmcinfo {
	int32_t		pm_cpu;		/* CPU number */
	struct pmc_info	pm_pmcs[];	/* NPMC structs */
};




=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F5A2B204-90CC-450C-9C0D-105934714FB0>