xiaoxiang781216 commented on a change in pull request #1280: URL: https://github.com/apache/incubator-nuttx/pull/1280#discussion_r445966549
########## File path: include/stdio.h ########## @@ -225,6 +216,49 @@ FILE *popen(FAR const char *command, FAR const char *mode); int pclose(FILE *stream); #endif +/* These APIs are not implemented and/or can be synthesized from + * supported APIs. + */ + +#ifdef CONFIG_HAVE_INLINE +static inline int putc(int c, FAR FILE *s) Review comment: > i can understand the performance argument for ctype functions. > but i'm not sure about these FILE* functions. have you measured? > I mean the ctype like functions when I mention the performance. If we have to use #ifdef/#endif for ctype function, why we use the different aproach for other functions? I prefer to keep the consistency. > if you really care the (IMO marginal) performance gain, > i think the traditional convention is to have a macro version overriding the non-inline function > so that any app which is not happy with the macro version can do "#undef getc" before using it. > like: > > ``` > int getc(FAR FILE *stream); > #define getc(s) fgetc(s) > ``` But I can't use this approach(add #undef ...), because the code is in the 3rd party library, I don't want to change their code if the code totally confirm the standard. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org