Ken,
On 4/29/2015 4:38 PM, Ken McDonell wrote:
We don't really have a formal position on a POSIX version that the
code is expected to comply with, other than the (old) -D_GNU_SOURCE in
the build which sort of means we can never be POSIX compliant (sigh).
This is in part because the POSIX story is confusing across all the
platforms we're trying to support, or at least was so at points of
time over the last 20+ years.
Rather we've gone down the path of isolating source code that is not
necessarily portable across all the platforms using HAVE_FOO macros
... in this case it would be HAVE_OPEN_MEMSTREAM. This works fine in
cases where the feature provides isolated functionality and the #else
path can either do nothing or return a relevant error such as
PM_ERR_APPVERSION.
Yeah, not the case here, as it would preclude use of the pmda.
But in this case I think you'd either have to
(a) assert that open_memstream() is available on any Linux platform
where PCP is expected to compile and just do it, or
(b) keep the existing implementation for the #else part and use
open_memstream() for an alternative (new and default) implementation
behind the #ifdef HAVE_OPEN_MEMSTREAM
The more I think about it, any change will probably add more complexity,
so not worth it.
Thanks
Martins
|