The Android NDK's version of cdefs.h defines __printflike as #define __printflike(x, y) __attribute__((__format__(printf, x, y))) which is valid as per https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-format-function-attribute but which conflicts with the redefinition of printf in gsio.h . The definition within the codebase uses __printf__ as the archetype to dodge this issue, but system definitions may not follow this convention.
Assigning to Chris as a build issue, but we may have other Android developers take (Fred?).
I'm curios as to why gsio.h does #undef printf #define printf Function._printf_.unavailable as opposed to something like #undef printf #define printf(...) (0)
In response to Fred: Ghostscript wants use of 'printf' to cause a compile error since we want everything to funnel through dprintf or eprintf so that the stdout and stderr output can be captured by the gs stdio callbacks.
Patch applied: https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=28d3245fbaff Thanks.