{"action":"created","comment":{"url":"https://api.github.com/repos/neovim/neovim/pulls/comments/27777881","id":27777881,"diff_hunk":"@@ -2782,8 +2782,7 @@ int get_tags(list_T *list, char_u *pat)\n       TAG_REGEXP | TAG_NOIC, (int)MAXCOL, NULL);\n   if (ret == OK && num_matches > 0) {\n     for (i = 0; i < num_matches; ++i) {\n-      int parse_result = parse_match(matches[i], &tp);\n-      assert(parse_result == OK);\n+      assert(parse_match(matches[i], &tp) == OK);","path":"src/nvim/tag.c","position":6,"original_position":6,"commit_id":"9d84d7d4e279f8853fd8ea61ae3e2db7fd7027aa","original_commit_id":"9d84d7d4e279f8853fd8ea61ae3e2db7fd7027aa","user":{"login":"jszakmeister","id":448087,"avatar_url":"https://avatars.githubusercontent.com/u/448087?v=3","gravatar_id":"","url":"https://api.github.com/users/jszakmeister","html_url":"https://github.com/jszakmeister","followers_url":"https://api.github.com/users/jszakmeister/followers","following_url":"https://api.github.com/users/jszakmeister/following{/other_user}","gists_url":"https://api.github.com/users/jszakmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/jszakmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszakmeister/subscriptions","organizations_url":"https://api.github.com/users/jszakmeister/orgs","repos_url":"https://api.github.com/users/jszakmeister/repos","events_url":"https://api.github.com/users/jszakmeister/events{/privacy}","received_events_url":"https://api.github.com/users/jszakmeister/received_events","type":"User","site_admin":false},"body":"We could use this sort of solution here instead:\r\n\r\n```c\r\n      int parse_result = parse_match(matches[i], &tp);\r\n      (void) parse_result;\r\n      assert(parse_result == OK);\r\n```\r\n\r\nThat avoids the warning, but works correctly.  Perhaps some of these can be wrapped with macros that do something similar?  Any thoughts?","created_at":"2015-04-05T14:53:34Z","updated_at":"2015-04-05T14:53:34Z","html_url":"https://github.com/neovim/neovim/pull/2353#discussion_r27777881","pull_request_url":"https://api.github.com/repos/neovim/neovim/pulls/2353","_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments/27777881"},"html":{"href":"https://github.com/neovim/neovim/pull/2353#discussion_r27777881"},"pull_request":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2353"}}},"pull_request":{"url":"https://api.github.com/repos/neovim/neovim/pulls/2353","id":32641595,"html_url":"https://github.com/neovim/neovim/pull/2353","diff_url":"https://github.com/neovim/neovim/pull/2353.diff","patch_url":"https://github.com/neovim/neovim/pull/2353.patch","issue_url":"https://api.github.com/repos/neovim/neovim/issues/2353","number":2353,"state":"open","locked":false,"title":"[RFC] Fix several unused variable warnings in the release build.","user":{"login":"jszakmeister","id":448087,"avatar_url":"https://avatars.githubusercontent.com/u/448087?v=3","gravatar_id":"","url":"https://api.github.com/users/jszakmeister","html_url":"https://github.com/jszakmeister","followers_url":"https://api.github.com/users/jszakmeister/followers","following_url":"https://api.github.com/users/jszakmeister/following{/other_user}","gists_url":"https://api.github.com/users/jszakmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/jszakmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszakmeister/subscriptions","organizations_url":"https://api.github.com/users/jszakmeister/orgs","repos_url":"https://api.github.com/users/jszakmeister/repos","events_url":"https://api.github.com/users/jszakmeister/events{/privacy}","received_events_url":"https://api.github.com/users/jszakmeister/received_events","type":"User","site_admin":false},"body":"I'm not particularly happy with this, so I'm definitely looking for feedback.  I'm tempted to remove the two asserts that necessitate the `#ifndef NDEBUG` lines.  I'm not quite sure what the concern is and why that was the right place to assert.  I mean, I understand what the code is trying to do, but I'm not sure what the benefit is.  It seems like both might be better caught by unit tests rather than having asserts in the code base.\r\n\r\nIn the fix for `tag.c`, I think it should probably be a runtime check rather than an assert.  There exists the possibility to exit with an error (unlike the others) and we probably should, but it's complicated as you'd have to free the memory consumed by matches (which requires looping through it from the point of failure to the end).  At least it can be converted to a one-liner though.\r\n\r\nAn alternate solution for `tag.c` might look like this:\r\n\r\n```c\r\ndiff --git a/src/nvim/tag.c b/src/nvim/tag.c\r\nindex a259c29..6826676 100644\r\n--- a/src/nvim/tag.c\r\n+++ b/src/nvim/tag.c\r\n@@ -2782,7 +2782,12 @@ int get_tags(list_T *list, char_u *pat)\r\n       TAG_REGEXP | TAG_NOIC, (int)MAXCOL, NULL);\r\n   if (ret == OK && num_matches > 0) {\r\n     for (i = 0; i < num_matches; ++i) {\r\n-      assert(parse_match(matches[i], &tp) == OK);\r\n+      if (parse_match(matches[i], &tp) != OK)\r\n+      {\r\n+        ret = FAIL;\r\n+        continue;\r\n+      }\r\n+\r\n       is_static = test_for_static(&tp);\r\n \r\n       /* Skip pseudo-tag lines. */\r\n```\r\n\r\nThis would allow it to continue through the loop and ultimately free the memory and return a failure, but I'm not quite sure that's the behavior we want either.\r\n\r\nOpinions welcome. ;-)  I took the simple way out here to start a discussion, but I'm willing to work this differently--assuming that it can be done without an insane amount of work.","created_at":"2015-04-04T23:54:30Z","updated_at":"2015-04-05T14:53:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1b494032a9db5da8f841d722c5f870f71a1e75c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/neovim/neovim/pulls/2353/commits","review_comments_url":"https://api.github.com/repos/neovim/neovim/pulls/2353/comments","review_comment_url":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/2353/comments","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/9d84d7d4e279f8853fd8ea61ae3e2db7fd7027aa","head":{"label":"jszakmeister:fix-unused-var-warnings-in-release","ref":"fix-unused-var-warnings-in-release","sha":"9d84d7d4e279f8853fd8ea61ae3e2db7fd7027aa","user":{"login":"jszakmeister","id":448087,"avatar_url":"https://avatars.githubusercontent.com/u/448087?v=3","gravatar_id":"","url":"https://api.github.com/users/jszakmeister","html_url":"https://github.com/jszakmeister","followers_url":"https://api.github.com/users/jszakmeister/followers","following_url":"https://api.github.com/users/jszakmeister/following{/other_user}","gists_url":"https://api.github.com/users/jszakmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/jszakmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszakmeister/subscriptions","organizations_url":"https://api.github.com/users/jszakmeister/orgs","repos_url":"https://api.github.com/users/jszakmeister/repos","events_url":"https://api.github.com/users/jszakmeister/events{/privacy}","received_events_url":"https://api.github.com/users/jszakmeister/received_events","type":"User","site_admin":false},"repo":{"id":17115700,"name":"neovim","full_name":"jszakmeister/neovim","owner":{"login":"jszakmeister","id":448087,"avatar_url":"https://avatars.githubusercontent.com/u/448087?v=3","gravatar_id":"","url":"https://api.github.com/users/jszakmeister","html_url":"https://github.com/jszakmeister","followers_url":"https://api.github.com/users/jszakmeister/followers","following_url":"https://api.github.com/users/jszakmeister/following{/other_user}","gists_url":"https://api.github.com/users/jszakmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/jszakmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszakmeister/subscriptions","organizations_url":"https://api.github.com/users/jszakmeister/orgs","repos_url":"https://api.github.com/users/jszakmeister/repos","events_url":"https://api.github.com/users/jszakmeister/events{/privacy}","received_events_url":"https://api.github.com/users/jszakmeister/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jszakmeister/neovim","description":"Vim's rebirth for the 21st century","fork":true,"url":"https://api.github.com/repos/jszakmeister/neovim","forks_url":"https://api.github.com/repos/jszakmeister/neovim/forks","keys_url":"https://api.github.com/repos/jszakmeister/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jszakmeister/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jszakmeister/neovim/teams","hooks_url":"https://api.github.com/repos/jszakmeister/neovim/hooks","issue_events_url":"https://api.github.com/repos/jszakmeister/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/jszakmeister/neovim/events","assignees_url":"https://api.github.com/repos/jszakmeister/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/jszakmeister/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/jszakmeister/neovim/tags","blobs_url":"https://api.github.com/repos/jszakmeister/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jszakmeister/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jszakmeister/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/jszakmeister/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jszakmeister/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/jszakmeister/neovim/languages","stargazers_url":"https://api.github.com/repos/jszakmeister/neovim/stargazers","contributors_url":"https://api.github.com/repos/jszakmeister/neovim/contributors","subscribers_url":"https://api.github.com/repos/jszakmeister/neovim/subscribers","subscription_url":"https://api.github.com/repos/jszakmeister/neovim/subscription","commits_url":"https://api.github.com/repos/jszakmeister/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/jszakmeister/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/jszakmeister/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/jszakmeister/neovim/issues/comments{/number}","contents_url":"https://api.github.com/repos/jszakmeister/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/jszakmeister/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jszakmeister/neovim/merges","archive_url":"https://api.github.com/repos/jszakmeister/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jszakmeister/neovim/downloads","issues_url":"https://api.github.com/repos/jszakmeister/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/jszakmeister/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/jszakmeister/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/jszakmeister/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jszakmeister/neovim/labels{/name}","releases_url":"https://api.github.com/repos/jszakmeister/neovim/releases{/id}","created_at":"2014-02-23T19:59:02Z","updated_at":"2015-04-05T13:43:30Z","pushed_at":"2015-04-05T13:43:29Z","git_url":"git://github.com/jszakmeister/neovim.git","ssh_url":"git@github.com:jszakmeister/neovim.git","clone_url":"https://github.com/jszakmeister/neovim.git","svn_url":"https://github.com/jszakmeister/neovim","homepage":"","size":29017,"stargazers_count":1,"watchers_count":1,"language":"VimL","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"neovim:master","ref":"master","sha":"73bf0551f891a13d76f436bf6a26933089539fa9","user":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"repo":{"id":16408992,"name":"neovim","full_name":"neovim/neovim","owner":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neovim/neovim","description":"vim out of the box","fork":false,"url":"https://api.github.com/repos/neovim/neovim","forks_url":"https://api.github.com/repos/neovim/neovim/forks","keys_url":"https://api.github.com/repos/neovim/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neovim/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neovim/neovim/teams","hooks_url":"https://api.github.com/repos/neovim/neovim/hooks","issue_events_url":"https://api.github.com/repos/neovim/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/neovim/neovim/events","assignees_url":"https://api.github.com/repos/neovim/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/neovim/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/neovim/neovim/tags","blobs_url":"https://api.github.com/repos/neovim/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neovim/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neovim/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/neovim/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/neovim/neovim/languages","stargazers_url":"https://api.github.com/repos/neovim/neovim/stargazers","contributors_url":"https://api.github.com/repos/neovim/neovim/contributors","subscribers_url":"https://api.github.com/repos/neovim/neovim/subscribers","subscription_url":"https://api.github.com/repos/neovim/neovim/subscription","commits_url":"https://api.github.com/repos/neovim/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/neovim/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/neovim/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/neovim/neovim/issues/comments{/number}","contents_url":"https://api.github.com/repos/neovim/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/neovim/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neovim/neovim/merges","archive_url":"https://api.github.com/repos/neovim/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neovim/neovim/downloads","issues_url":"https://api.github.com/repos/neovim/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/neovim/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/neovim/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/neovim/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neovim/neovim/labels{/name}","releases_url":"https://api.github.com/repos/neovim/neovim/releases{/id}","created_at":"2014-01-31T13:39:22Z","updated_at":"2015-04-05T14:19:04Z","pushed_at":"2015-04-05T14:23:04Z","git_url":"git://github.com/neovim/neovim.git","ssh_url":"git@github.com:neovim/neovim.git","clone_url":"https://github.com/neovim/neovim.git","svn_url":"https://github.com/neovim/neovim","homepage":"http://neovim.org","size":56074,"stargazers_count":12727,"watchers_count":12727,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":860,"mirror_url":null,"open_issues_count":444,"forks":860,"open_issues":444,"watchers":12727,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2353"},"html":{"href":"https://github.com/neovim/neovim/pull/2353"},"issue":{"href":"https://api.github.com/repos/neovim/neovim/issues/2353"},"comments":{"href":"https://api.github.com/repos/neovim/neovim/issues/2353/comments"},"review_comments":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2353/comments"},"review_comment":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2353/commits"},"statuses":{"href":"https://api.github.com/repos/neovim/neovim/statuses/9d84d7d4e279f8853fd8ea61ae3e2db7fd7027aa"}}}}