{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/3583","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/3583/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/3583/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/3583/events","html_url":"https://github.com/kripken/emscripten/issues/3583","id":91358315,"number":3583,"title":"Suggest FAQ entry: how to use a C library in Javascript","user":{"login":"qwertie","id":720717,"avatar_url":"https://avatars.githubusercontent.com/u/720717?v=3","gravatar_id":"","url":"https://api.github.com/users/qwertie","html_url":"https://github.com/qwertie","followers_url":"https://api.github.com/users/qwertie/followers","following_url":"https://api.github.com/users/qwertie/following{/other_user}","gists_url":"https://api.github.com/users/qwertie/gists{/gist_id}","starred_url":"https://api.github.com/users/qwertie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qwertie/subscriptions","organizations_url":"https://api.github.com/users/qwertie/orgs","repos_url":"https://api.github.com/users/qwertie/repos","events_url":"https://api.github.com/users/qwertie/events{/privacy}","received_events_url":"https://api.github.com/users/qwertie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-06-26T20:46:20Z","updated_at":"2015-07-15T23:57:02Z","closed_at":null,"body":"So I wrote this file, `lowercase.c`:\r\n\r\n    char toLower(char c)\r\n    {\r\n      return c >= 'A' && c <= 'Z' ? c + ('a' - 'A') : c;\r\n    }\r\n    void strToLower(char* buf)\r\n    {\r\n      for (int i = 0; buf[i]; i++)\r\n        buf[i] = toLower(buf[i]);\r\n    }\r\n\r\n`emcc lowercase.c` succeeds, but the output is 9000 lines and I can't find `toLower` in the output anywhere. After browsing the FAQ, I try adding `--closure 1` to get shorter output and `-s EXPORTED_FUNCTIONS=...` to hopefully make my symbols appear. Neither of these works for me:\r\n\r\n    D:\\...>emcc lowercase.c -s EXPORTED_FUNCTIONS=\"['strToLower','toLower']\" --closure 1\r\n    WARNING  root: disabling closure because debug info was requested\r\n    WARNING  root: function requested to be exported, but not implemented: \"strToLower\"\r\n    WARNING  root: function requested to be exported, but not implemented: \"toLower\"\r\n\r\nHow do I fix this, and then, how could I use this code to convert a Javascript string to lowercase?"},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/121778959","html_url":"https://github.com/kripken/emscripten/issues/3583#issuecomment-121778959","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/3583","id":121778959,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T23:57:02Z","updated_at":"2015-07-15T23:57:02Z","body":"Depends how smart closure is. If the code is put in a function scope (MODULARIZE), then it is provable that most of the code is dead. Not sure if closure actually does that, though."}}