Do not treat integer literals 0u, 0l as base-8
Only literals with a digit following the initial 0 should be understood as base-8.
This commit is contained in:
parent
ae0ab674ab
commit
591d8829e1
|
@ -0,0 +1,6 @@
|
|||
int main()
|
||||
{
|
||||
unsigned x;
|
||||
x=0u;
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
CORE
|
||||
main.c
|
||||
--show-goto-functions
|
||||
^EXIT=0$
|
||||
^SIGNAL=0$
|
||||
--
|
||||
00u
|
||||
^warning: ignoring
|
|
@ -75,7 +75,7 @@ exprt convert_integer_literal(const std::string &src)
|
|||
std::string without_prefix(src, 2, std::string::npos);
|
||||
value=string2integer(without_prefix, 2);
|
||||
}
|
||||
else if(src.size()>=2 && src[0]=='0')
|
||||
else if(src.size()>=2 && src[0]=='0' && isdigit(src[1]))
|
||||
{
|
||||
// octal
|
||||
base=8;
|
||||
|
|
Loading…
Reference in New Issue