Frama-C Bug Tracking System - Frama-C
View Issue Details
0002348Frama-CPlug-in > clangpublic2018-01-30 16:312018-01-30 18:03
jens 
virgile 
normalminoralways
assignedopen 
 
 
0002348: unknown variable in contract is not treated as an error
The attached C/C++ code is treated differently by Frama-C and Frama-Clang
The C file 'unknown_variable.c' is correctly rejected by Frama-C with wit the the message

    frama-c -wp -wp-rte unknown_variable.c

   [kernel] user error: stopping on file "unknown_variable.c" that has errors. Add
    '-kernel-msg-key pp' for preprocessing command.

When processing this file as C++ code

   frama-c -wp -wp-rte unknown_variable.cpp

Frama-Clang only emits a warning (by the kernel) and continues processing

   Parsing unknown_variable.cpp (external front-end)
unknown_variable.cpp:6:18: unknown identifier 'c'
Now output intermediate result

In my opinion, the C++ contract should be rejected as well.

No tags attached.
c unknown_variable.c (88) 2018-01-30 16:31
https://bts.frama-c.com/file_download.php?file_id=1230&type=bug
cpp unknown_variable.cpp (88) 2018-01-30 16:31
https://bts.frama-c.com/file_download.php?file_id=1231&type=bug
Issue History
2018-01-30 16:31jensNew Issue
2018-01-30 16:31jensStatusnew => assigned
2018-01-30 16:31jensAssigned To => virgile
2018-01-30 16:31jensFile Added: unknown_variable.c
2018-01-30 16:31jensFile Added: unknown_variable.cpp
2018-01-30 18:03virgileNote Added: 0006512

Notes
(0006512)
virgile   
2018-01-30 18:03   
If I'm not mistaken, Frama-Clang implements the old "continue-annot-error" behavior, but nevertheless the warning should have come from the plug-in, not the kernel.