On Thu, Mar 19, 2020 at 7:59 PM Xiang Xiao <xiaoxiang781...@gmail.com> wrote: > > On Thu, Mar 19, 2020 at 6:39 PM Takashi Yamamoto > <yamam...@midokura.com.invalid> wrote: > > > > do you feel the returning-structure version less uglier? > > Yes, returning-structure is a bad design in most case, but we can't > change mallinfo prototype since it is defined by other OS: > http://man7.org/linux/man-pages/man3/mallinfo.3.html
i wasn't aware of that implementation. thank you. i'm skeptical about the usefulness of the compatibility with it though. it's non-standard anyway. > > > my feeling is the opposite. > > after all, it's a matter of taste i guess. > > > > I mean the code contained #ifdef/#endif is more uglier than other. > there are many place conditioned by CAN_PASS_STRUCTS, mallinfo is just > one of case. It's better to fix all places instead. > > > On Thu, Mar 19, 2020 at 7:22 PM Xiang Xiao <xiaoxiang781...@gmail.com> > > wrote: > > > > > > But, should we support the aged compiler to make the code ugly? I > > > prefer to remove CAN_PASS_STRUCTS option and clean up the whole code > > > base. > > > > > > On Thu, Mar 19, 2020 at 2:41 PM Takashi Yamamoto > > > <yamam...@midokura.com.invalid> wrote: > > > > > > > > hi, > > > > > > > > depending on CONFIG_CAN_PASS_STRUCTS, > > > > mallinfo has a different prototype. > > > > > > > > #ifdef CONFIG_CAN_PASS_STRUCTS > > > > struct mallinfo mallinfo(void); > > > > #else > > > > int mallinfo(FAR struct mallinfo *info); > > > > #endif > > > > > > > > and we have a lot of #ifdef CONFIG_CAN_PASS_STRUCTS > > > > for this even in APPDIR. > > > > i'd like to suggest to simplify this by always using > > > > "int mallinfo(FAR struct mallinfo *info);" version. > > > > > > > > or, even "void mallinfo(FAR struct mallinfo *info);" because it > > > > doesn't return any errors. > > > > > > > > how do you think?