diff options
author | Carl Worth <cworth@cworth.org> | 2010-06-22 15:51:34 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-06-23 16:13:31 -0700 |
commit | c42e64099b80e112eb0b172801a7107e143f78dc (patch) | |
tree | 8afa857e5620ab585c01b61737638d0571c07587 | |
parent | 726faddda2d69ea0f81da8e81c6a2e0f3fb6fdda (diff) |
preprocessor: Initialize a potentially uninitialized variable.
My current reading of the relevant static functions suggests that last
is never used without being uninitialized, (we only use it if the
expansion function returned non-NULL and the expansion functions
always set it before returning non-NULL).
Apparently gcc isn't coming to the same conclusion. Initializing this
to NULL nicely quites gcc and will guarantee a nice, early segfault if
my anaylsis turns out to be wrong.
-rw-r--r-- | glcpp/glcpp-parse.y | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/glcpp/glcpp-parse.y b/glcpp/glcpp-parse.y index 88a30f8975..6beac18c65 100644 --- a/glcpp/glcpp-parse.y +++ b/glcpp/glcpp-parse.y @@ -1312,7 +1312,7 @@ _glcpp_parser_expand_token_list (glcpp_parser_t *parser, token_list_t *list) { token_node_t *node_prev; - token_node_t *node, *last; + token_node_t *node, *last = NULL; token_list_t *expansion; if (list == NULL) |