Date: Mon, 11 Jun 2018 16:09:54 +0000 (UTC) From: Ryan Libby <rlibby@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334957 - in head: lib/libpmc usr.sbin/pmc Message-ID: <201806111609.w5BG9sD7038609@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rlibby Date: Mon Jun 11 16:09:54 2018 New Revision: 334957 URL: https://svnweb.freebsd.org/changeset/base/334957 Log: pmc gcc fixups Fix the build of lib/libpmc and usr.sbin/pmc for gcc on amd64. Reviewed by: mmacy Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15723 Modified: head/lib/libpmc/Makefile head/usr.sbin/pmc/Makefile head/usr.sbin/pmc/cmd_pmc_filter.cc Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Mon Jun 11 15:44:53 2018 (r334956) +++ head/lib/libpmc/Makefile Mon Jun 11 16:09:54 2018 (r334957) @@ -7,6 +7,7 @@ SRCS= libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json. INCS= pmc.h pmclog.h pmcformat.h CFLAGS+= -I${.CURDIR} +CWARNFLAGS.gcc+= -Wno-shadow .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" Modified: head/usr.sbin/pmc/Makefile ============================================================================== --- head/usr.sbin/pmc/Makefile Mon Jun 11 15:44:53 2018 (r334956) +++ head/usr.sbin/pmc/Makefile Mon Jun 11 16:09:54 2018 (r334957) @@ -5,7 +5,8 @@ .include <src.opts.mk> PROG_CXX= pmc MAN= -CXXFLAGS+= -O0 +CXXFLAGS+= -O0 -std=c++14 +CWARNFLAGS.gcc+= -Wno-redundant-decls LIBADD= kvm pmc m ncursesw pmcstat elf Modified: head/usr.sbin/pmc/cmd_pmc_filter.cc ============================================================================== --- head/usr.sbin/pmc/cmd_pmc_filter.cc Mon Jun 11 15:44:53 2018 (r334956) +++ head/usr.sbin/pmc/cmd_pmc_filter.cc Mon Jun 11 16:09:54 2018 (r334957) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include <libpmcstat.h> #include "cmd_pmc.h" -#include <iostream> #include <string> #include <unordered_map> @@ -182,11 +181,11 @@ static void pmc_log_event(int fd, struct pmclog_ev *ev, bool json) { int len; - void *buf; + const void *buf; if (json) { string ret = event_to_json(ev); - buf = (void*)ret.c_str(); + buf = ret.c_str(); len = ret.size(); } else { len = ev->pl_len; @@ -233,7 +232,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui pmclog_close(ps); if ((ps = static_cast < struct pmclog_parse_state *>(pmclog_open(infd)))== NULL) errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: %s\n", strerror(errno)); - if ((pe = (typeof(pe)) malloc(sizeof(*pe) * pmccount)) == NULL) + if ((pe = (struct pmcid_ent *) malloc(sizeof(*pe) * pmccount)) == NULL) errx(EX_OSERR, "ERROR: failed to allocate pmcid map"); i = 0; while (pmclog_read(ps, &ev) == 0 && i < pmccount) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806111609.w5BG9sD7038609>