{"action":"created","issue":{"url":"https://api.github.com/repos/openssl/openssl/issues/1415","repository_url":"https://api.github.com/repos/openssl/openssl","labels_url":"https://api.github.com/repos/openssl/openssl/issues/1415/labels{/name}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/1415/comments","events_url":"https://api.github.com/repos/openssl/openssl/issues/1415/events","html_url":"https://github.com/openssl/openssl/issues/1415","id":169702467,"number":1415,"title":"Consider getting rid of function codes.","user":{"login":"davidben","id":109690,"avatar_url":"https://avatars.githubusercontent.com/u/109690?v=3","gravatar_id":"","url":"https://api.github.com/users/davidben","html_url":"https://github.com/davidben","followers_url":"https://api.github.com/users/davidben/followers","following_url":"https://api.github.com/users/davidben/following{/other_user}","gists_url":"https://api.github.com/users/davidben/gists{/gist_id}","starred_url":"https://api.github.com/users/davidben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidben/subscriptions","organizations_url":"https://api.github.com/users/davidben/orgs","repos_url":"https://api.github.com/users/davidben/repos","events_url":"https://api.github.com/users/davidben/events{/privacy}","received_events_url":"https://api.github.com/users/davidben/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/openssl/openssl/milestones/2","html_url":"https://github.com/openssl/openssl/milestones/Post%201.1.0","labels_url":"https://api.github.com/repos/openssl/openssl/milestones/2/labels","id":1749719,"number":2,"title":"Post 1.1.0","description":null,"creator":{"login":"mattcaswell","id":7422273,"avatar_url":"https://avatars.githubusercontent.com/u/7422273?v=3","gravatar_id":"","url":"https://api.github.com/users/mattcaswell","html_url":"https://github.com/mattcaswell","followers_url":"https://api.github.com/users/mattcaswell/followers","following_url":"https://api.github.com/users/mattcaswell/following{/other_user}","gists_url":"https://api.github.com/users/mattcaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcaswell/subscriptions","organizations_url":"https://api.github.com/users/mattcaswell/orgs","repos_url":"https://api.github.com/users/mattcaswell/repos","events_url":"https://api.github.com/users/mattcaswell/events{/privacy}","received_events_url":"https://api.github.com/users/mattcaswell/received_events","type":"User","site_admin":false},"open_issues":69,"closed_issues":4,"state":"open","created_at":"2016-05-05T14:13:08Z","updated_at":"2016-08-05T21:47:50Z","due_on":null,"closed_at":null},"comments":14,"created_at":"2016-08-05T21:44:49Z","updated_at":"2016-08-06T14:15:16Z","closed_at":null,"body":"This is no doubt too late for 1.1.0, but perhaps 1.2.0. (Or perhaps earlier if you don't mind making some APIs start kinda lying.)\r\n\r\nThe function codes in err are kind of nuts. They make development cumbersome (function codes must be updated whenever a new function that uses err is added), are a backwards compatibility nightmare if anyone tries to condition on them (rare, but happens on occasion), easy to mess up (code routinely uses the wrong one?), and impede refactoring like renaming non-public functions.\r\n\r\nIn BoringSSL, we got rid of them. First with the following scheme:\r\n\r\n* The error code itself never contains a function code number. It's always zero.\r\n* `ERR_func_error_string` always returns the special value `OPENSSL_internal`. Imagine that OpenSSL decided to turn every function into a wrapper over a static function named `OPENSSL_internal`. It'd be nonsense but legal C. This extends to be behavior of `ERR_error_string_n`.\r\n* `ERR_put_error` currently samples and stores `__FILE__` and `__LINE__` out-of-band. Also sample `__func__` and store that. This requires changing `ERR_put_error` or adding an `ERR_put_error_ex`.\r\n* `ERR_print_errors_cb` extracted this internal value and, rather than the unhelpful `OPENSSL_internal`, printed the true out-of-band function name.\r\n\r\nThat was a huge productivity win, but not a binary size one. We later decided sampling `__func__` really wasn't very useful and wasted binary size in every BoringSSL consumer. We undid the changes to `ERR_put_error` and `ERR_print_errors_cb`. Now we always report function names as `OPENSSL_internal`.\r\n\r\nThis is fairly simple and seems to have worked just fine. If you're using the function codes for logging, the file and line number are readily available and strictly more useful. If you're using them for anything programmatic... don't. No other library lets consumers condition on the internal implementation details like this."},"comment":{"url":"https://api.github.com/repos/openssl/openssl/issues/comments/238025254","html_url":"https://github.com/openssl/openssl/issues/1415#issuecomment-238025254","issue_url":"https://api.github.com/repos/openssl/openssl/issues/1415","id":238025254,"user":{"login":"richsalz","id":7332500,"avatar_url":"https://avatars.githubusercontent.com/u/7332500?v=3","gravatar_id":"","url":"https://api.github.com/users/richsalz","html_url":"https://github.com/richsalz","followers_url":"https://api.github.com/users/richsalz/followers","following_url":"https://api.github.com/users/richsalz/following{/other_user}","gists_url":"https://api.github.com/users/richsalz/gists{/gist_id}","starred_url":"https://api.github.com/users/richsalz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richsalz/subscriptions","organizations_url":"https://api.github.com/users/richsalz/orgs","repos_url":"https://api.github.com/users/richsalz/repos","events_url":"https://api.github.com/users/richsalz/events{/privacy}","received_events_url":"https://api.github.com/users/richsalz/received_events","type":"User","site_admin":false},"created_at":"2016-08-06T14:15:16Z","updated_at":"2016-08-06T14:15:16Z","body":"Something for our F2F tech discussion.\r\n"}}
{"actor":{"display_login":"richsalz"}}