Parsing a file with including some bits of the STL
The following file does not parse when running frama-c testing.cpp
, with Frama-Clang 0.0.11 installed, with a Frama-C 23.1+dev, OCaml 4.13, in Ubuntu 20.04:
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"Hello World"<<endl;
return 0;
}
It results in:
[kernel] Parsing testing.cpp (external front-end)
In file included from /home/harshit/Desktop/testing.cpp:1:
In file included from /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9/bits/stdc++.h:35:
In file included from /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/cctype:41:
In file included from /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9/bits/c++config.h:524:
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9/bits/os_defines.h:44:5: error: function-like macro '__GLIBC_PREREQ' is not defined
#if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)
^
In file included from /home/harshit/Desktop/testing.cpp:1:
In file included from /usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9/bits/stdc++.h:41:
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/cmath:45:15: fatal error: 'math.h' file not found
#include_next <math.h>
^~~~~~~~
code generation aborted due to compilation errors
[kernel] User Error: Failed to parse C++ file. See Clang messages for more information
[kernel] User Error: stopping on file "testing.cpp" that has errors.
[kernel] Frama-C aborted: invalid user input.
Is there a way to parse it? Does it require some specific command-line option?
(issue migrated from a comment in the old, now archived, Frama-Clang Github repository: https://github.com/Frama-C/Frama-C-snapshot/issues/45)