Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
src: squelch -Wmaybe-uninitialized warning
Browse files Browse the repository at this point in the history
The variable isn't actually used uninitialized but g++ 4.8 doesn't know
that.  Set it to NULL to silence the following compiler warning:

    ../src/string_bytes.cc:247:29: warning: 'data' may be used
    uninitialized in this function [-Wmaybe-uninitialized]
         unsigned a = hex2bin(src[i * 2 + 0]);
                                  ^
    ../src/string_bytes.cc:299:15: note: 'data' was declared here
       const char* data;
                   ^
  • Loading branch information
bnoordhuis authored and indutny committed Mar 16, 2014
1 parent 91b4a56 commit a3dca9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/string_bytes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ size_t StringBytes::Write(Isolate* isolate,
enum encoding encoding,
int* chars_written) {
HandleScope scope(isolate);
const char* data;
const char* data = NULL;
size_t len = 0;
bool is_extern = GetExternalParts(isolate, val, &data, &len);

Expand Down

0 comments on commit a3dca9a

Please sign in to comment.