Project

General

Profile

Actions

Bug #9894

closed

Frama-C (CIL) cannot represent an integer

Added by Ilja Zakharov over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Start date:
10/28/2019
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

Description

CIL fails with the following error:

[kernel] /fast/build bases/busybox/Storage/fast/programs/busybox/libbb/xatonum_template.c:161:47: Failure:
Cannot represent the integer 9223372036854775808LL

please, find the file in the attachment.


Files

example-2.tar.gz (36.5 KB) example-2.tar.gz Ilja Zakharov, 10/28/2019 05:29 PM
Actions #1

Updated by Mikhail Mandrykin over 4 years ago

  • Status changed from New to Resolved

Changed integral type selection for constants when in GCC compatibility mode (-machdep gcc_x86_*) (commit c0d393e8). Now Frama-C tries all available integral types to represent the constant, disregarding the specified LL postfix (as does GCC). The problem is that according to ISO (C11 / ISO/IEC 9899:201x), there are no negative integer constants and expressions such as -1 apply the unary minus operator to the value represented by the positive constant. Thus the constant 9223372036854775808LL cannot be represented as long long. Yet it can be represented as unsigned long long and later can be converted to long long, though in general the result in this case is implementation-defined.

Actions #2

Updated by Mikhail Mandrykin over 4 years ago

  • Assignee set to Mikhail Mandrykin
Actions #3

Updated by Ilja Zakharov over 4 years ago

Works fine, I think the issue can be closed.

Actions #4

Updated by Evgeny Novikov over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF