parser.c:350:14: warning: variable 'dest' is used uninitialized whenever 'if' condition is false
else if ((src[0] & 0xf8) == 0xf0)
^~~~~~~~~~~~~~~~~~~~~~~
parser.c:375:12: note: uninitialized use occurs here
return dest;
^~~~
parser.c:350:10: note: remove the 'if' if its condition is always true
else if ((src[0] & 0xf8) == 0xf0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
parser.c:307:18: note: initialize the variable 'dest' to silence this warning
uint32_t dest;
^
= 0
In this case the warning is spurious (the `else` branch raises an
exception, so it is not possible for `dest` to be used unuinitialized).
But Clang doesn't know that, so keep it happy by initializing the
variable every time.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
-// Copyright 2007-2012 Wincent Colaiuta. All rights reserved.
+// Copyright 2007-2013 Wincent Colaiuta. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// Raises a RangeError if the supplied character is invalid UTF-8.
uint32_t wiki_utf8_to_utf32(char *src, char *end, long *width_out)
{
- uint32_t dest;
+ uint32_t dest = 0;
if ((unsigned char)src[0] <= 0x7f)
{
// ASCII