Skip to content

Commit b8fce65

Browse files
author
Daniel Kroening
authored
Merge pull request #1325 from tautschnig/double-output
[develop->master] Do not add an "l" prefix to double constants when double==long double
2 parents deeb26e + 187395f commit b8fce65

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

regression/cbmc/Float24/main.c

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int main()
2+
{
3+
double d=5.1;
4+
__CPROVER_assert(0, "");
5+
return 0;
6+
}

regression/cbmc/Float24/test.desc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
main.c
3+
--win32 --xml-ui
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
VERIFICATION FAILED
7+
<full_lhs_value>5\.1</full_lhs_value>
8+
--
9+
^warning: ignoring
10+
<full_lhs_value>5\.1l</full_lhs_value>

src/ansi-c/expr2c.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,8 @@ std::string expr2ct::convert_constant(
18471847
// ANSI-C: double is default; float/long-double require annotation
18481848
if(src.type()==float_type())
18491849
dest+='f';
1850-
else if(src.type()==long_double_type())
1850+
else if(src.type()==long_double_type() &&
1851+
double_type()!=long_double_type())
18511852
dest+='l';
18521853
}
18531854
else if(dest.size()==4 &&

0 commit comments

Comments
 (0)