Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix dead store in `uf` variable #167

Closed
wants to merge 1 commit into from

3 participants

@charliesome

This popped up when running clang-analyzer over http-parser:

http_parser.c:2122:3: warning: Value stored to 'uf' is never read
  uf = old_uf = UF_MAX;
  ^    ~~~~~~~~~~~~~~~
http_parser.c
@@ -99,7 +99,7 @@
FOR##_mark = NULL; \
} \
} while (0)
-
+
@indutny Collaborator
indutny added a note

Unrelated change, please remove.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@indutny
Collaborator

One small style nit, otherwise LGTM. Seems like it is really set in all possible cases.

@charliesome charliesome Fix dead store in `uf` variable
http_parser.c:2122:3: warning: Value stored to 'uf' is never read
  uf = old_uf = UF_MAX;
  ^    ~~~~~~~~~~~~~~~
29a4016
@indutny
Collaborator

One last thing, could you please sign CLA?

@indutny
Collaborator

It is there, just in case: http://nodejs.org/cla.html

@charliesome

It's a 5 char patch, signing a CLA seems a bit over the top.

@indutny
Collaborator

@charliesome sorry, I am not the one who invented that rules, I'm just the one who should follow them.

@charliesome

@indutny This patch is just a deletion, it does not add any new code. This is not a copyrightable contribution, therefore a CLA is unnecessary.

@tjfontaine
@charliesome charliesome deleted the charliesome:fix-clang-analyzer-warning branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 17, 2014
  1. @charliesome

    Fix dead store in `uf` variable

    charliesome authored
    http_parser.c:2122:3: warning: Value stored to 'uf' is never read
      uf = old_uf = UF_MAX;
      ^    ~~~~~~~~~~~~~~~
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  http_parser.c
View
2  http_parser.c
@@ -2119,7 +2119,7 @@ http_parser_parse_url(const char *buf, size_t buflen, int is_connect,
u->port = u->field_set = 0;
s = is_connect ? s_req_server_start : s_req_spaces_before_url;
- uf = old_uf = UF_MAX;
+ old_uf = UF_MAX;
for (p = buf; p < buf + buflen; p++) {
s = parse_url_char(s, *p);
Something went wrong with that request. Please try again.