I was using gcc6 from the MacPorts distribution.

The compile error is in the core foundation headers (objective C / C mix), nothing that can be done.  A known problem with Mac OS X 10.12.x and gcc.  (e.g. )