Fix warnings with lib/libpmc
authorEnji Cooper <ngie@FreeBSD.org>
Sun, 14 Apr 2019 00:06:49 +0000 (00:06 +0000)
committerEnji Cooper <ngie@FreeBSD.org>
Sun, 14 Apr 2019 00:06:49 +0000 (00:06 +0000)
commitb3d01a2ad7f16bb20f6fb58bb34f9339396c0075
tree67f251a3b4d3109079559fb716c8b51aad8f51fd
parentf0dfbcccf45f88185edf08c8ab71386f23f2f678
Fix warnings with lib/libpmc

* Use `MIN` instead of similar hand rolled macro.
* Sort headers.
* Use `errno.h` instead of `sys/errno.h`.
* Wrap the argument to sizeof in parentheses for clarity.
* Remove `__BSD_VISIBLE` and `_XOPEN_SOURCE` #defines to mute warnings about
  incompatible snprintf definitions.

This fixes a number of warnings I've been seeing lately in my builds.

Sort makefile variables per style.Makefile(9) (`CFLAGS`/`CWARNFLAG.gcc`) and
bump `WARNS` to 3.

MFC after: 2 weeks
Reviewed by: jtl
Approved by: jtl (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19851
lib/libpmc/Makefile
lib/libpmc/Makefile.inc [new file with mode: 0644]
lib/libpmc/libpmc_json.cc
lib/libpmc/pmu-events/jevents.c
lib/libpmc/pmu-events/jevents.h