You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/11/21 15:54:58 UTC

[GitHub] [mynewt-core] kasjer opened a new pull request #2109: libs/baselibc: Fix double fflush definition problem (#2076)

kasjer opened a new pull request #2109: libs/baselibc: Fix double fflush definition problem (#2076)
URL: https://github.com/apache/mynewt-core/pull/2109
 
 
   fflush double definition problem happens when baselibc version (B)
   collides with tool chain provided one (A).
   It can happen when other symbol located in (A) for example printf()
   refers fflush().
   (B) provides it's own version of printf() so it is not culprit
   that pulls something form (A).
   
   Function that actually pulls fflush() from (A) is putchar().
   (B) provided definition of putchar() would work if it was not
   for optimization done on simple printf's by gcc.
   For one char prints like:
   printf("a");
   printf("%c", 1);
   
   gcc chooses to change call to printf() with call to putchar(), but
   at that time it just expects function putchar() to exists and
   in (B) we have only macro that does not produces putchar symbol.
   
   Simple solution is to conjure up symbol putchar in (B) so (A) version
   is not needed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services