Frama-C Bug Tracking System - Frama-C
View Issue Details
0002342Frama-CPlug-in > clangpublic2018-01-18 07:542018-01-18 08:55
jens 
virgile 
normalminoralways
confirmedopen 
linux
 
 
0002342: std::bad_alloc not supported
Attached is a simple C++ (03) program that checks whether 'new' has thrown an exception. I am not yet sure whether this is due to general lack of exceptions or just a library issue. I report just for completeness.
Call 'frama-c -val new_bad_alloc.cpp'
No tags attached.
cpp new_bad_alloc.cpp (166) 2018-01-18 07:54
https://bts.frama-c.com/file_download.php?file_id=1223&type=bug
Issue History
2018-01-18 07:54jensNew Issue
2018-01-18 07:54jensStatusnew => assigned
2018-01-18 07:54jensAssigned To => virgile
2018-01-18 07:54jensFile Added: new_bad_alloc.cpp
2018-01-18 07:56jensNote Added: 0006507
2018-01-18 08:55virgileNote Added: 0006508
2018-01-18 08:55virgileStatusassigned => confirmed

Notes
(0006507)
jens   
2018-01-18 07:56   
frama-clang version 0.0.4 (+ static-patch)
(0006508)
virgile   
2018-01-18 08:55   
There are two things here: - std::bad_alloc is indeed not declared in fclang's header - the translation of new is currently a plain malloc, without the possibility of throwing an exception (i.e., frama-clang assumes allocation succeeds). The former is quite easy to change, the latter requires slightly more work.