On Thu, Jun 11, 2020 at 03:08:01PM +0200, Marc Espie wrote: > On Thu, Jun 11, 2020 at 04:37:34AM +0000, sensiblehue wrote: > > Hello, > > I was wondering why OpenBSD doesn't have a `__printflike' macro in > > <sys/cdefs.h>? FreeBSD, NetBSD, and DragonflyBSD have it and it's also > > available from libbsd on Linux. > > Personally I think it's cleaner and just as portable if not more > > portable, because some compilers don't support `__attribute__'. > > > What compilers ?
GCC < v2.5 and non GNU C compilers, though I see now that OpenBSD defines it to nothing in that case. What could be an issue is that the `format' attribute appeared in GCC v2.7, and invalid attributes generate a warning. To be honest I'm mostly suggesting __printflike because I want to use it in my own code and still have it compile on OpenBSD without an #ifdef, but it would also make software from other BSDs easier to port.