On Thu, Mar 19, 2020 at 10:11 AM Gregory Nutt <spudan...@gmail.com> wrote: > > i'm not suggesting to remove SDCC support or whatever. > > my proposal is the opposite. > > always use the conservative prototype. > > There are a hieararchy of standards governing NuttX interfaces. The > POSIX/ANSII/IEEE standard for a a Unix system as defined at > OpenGroup.org. And you are right, mallinfo is not specified there. > > But the second level of standards supported by NuttX are the Linux > definitions. It does have a Linux Standards Base (LSB), although its > control is sloppy and permissive. The form of mallinfo() is defined by > that Linux specification as you can see with 'man mallinfo'
In addition to POSIX/ANSI/IEEE and LSB, NuttX is written to C89 (mostly). However, as Greg points out, this particular (non-ANSI, non-C89) interface comes to us from LSB. And if there is this interface, then there are probably others. For reasons like this, I think CONFIG_CAN_PASS_STRUCTS is a good compromise. That way, we can be: o Loosely C89 except where being C89 interferes with other standards o Strictly C89 at the cost of losing some compliance with other standards And most importantly, the end-user can choose which option is best for the end-user's needs. (And, yes, we have to be very careful not to turn into a GCC-only, ARM-only, Linux-only system.) Nathan