{"action":"closed","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/2361","repository_url":"https://api.github.com/repos/micropython/micropython","labels_url":"https://api.github.com/repos/micropython/micropython/issues/2361/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/2361/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/2361/events","html_url":"https://github.com/micropython/micropython/issues/2361","id":173514309,"number":2361,"title":"Unix: Use *printf() function provided by the OS","user":{"login":"dxxb","id":896402,"avatar_url":"https://avatars.githubusercontent.com/u/896402?v=3","gravatar_id":"","url":"https://api.github.com/users/dxxb","html_url":"https://github.com/dxxb","followers_url":"https://api.github.com/users/dxxb/followers","following_url":"https://api.github.com/users/dxxb/following{/other_user}","gists_url":"https://api.github.com/users/dxxb/gists{/gist_id}","starred_url":"https://api.github.com/users/dxxb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dxxb/subscriptions","organizations_url":"https://api.github.com/users/dxxb/orgs","repos_url":"https://api.github.com/users/dxxb/repos","events_url":"https://api.github.com/users/dxxb/events{/privacy}","received_events_url":"https://api.github.com/users/dxxb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-08-26T18:26:45Z","updated_at":"2016-09-05T11:25:06Z","closed_at":"2016-09-05T11:25:06Z","body":"I am loading a shared library using FFI which uses vsnprintf(), micropython defines it's own vsnprintf() which ultimately calls mp_vprintf() and the dynamic linker decides to use micropython's vsnprintf() which has undefined behaviour for unsupported format specifiers.\r\n\r\nSo my options are:\r\n- Make micropython use libc's *printf() functions. How do I do that? I tried removing lib/utils/printf.c from LIB_SRC_C and it seems to work ok but it probably has side effects I am unaware of.\r\n- Hide *printf() symbols using visibility options when linking micropython (I tried, no joy)\r\n- Implement format specifiers in mp_vprintf() each time I stumble upon an unsupported one I need.\r\n\r\nI figured the best option is to make micropython use libc's implementation because it doesn't require changes to mp_vprintf(). Any advice please? Thank you.\r\n"}}
{"actor":{"display_login":"dxxb"}}