simplecpp
simplecpp copied to clipboard
C++ preprocessor
```` ./cppcheck --check-config gui ```` crashes inside simplecpp: ```` 49/53 files checked 89% done Checking gui/translationhandler.cpp ... [gui/translationhandler.cpp:19]: (information) Include file: not found. Please note: Cppcheck does not need standard...
When trying to reuse the simplecpp for device tree it turns out that simplecpp changes spacing such that the output can't be read by the device tree compiler. simplepcc inserts...
This file inspired by https://github.com/TinyCC/tinycc/blob/mob/tests/pp/02.c ```C #define x 3 #define f(a) f(x * (a)) #undef x #define x 2 #define g f #define z z[0] #define h g(~ #define m(a)...
The following testcode from clang https://raw.githubusercontent.com/clang-ykt/clang/master/INPUTS/stpcpy-test.c causes simplecpp to choke (run out of memory): ```c++ #define __extension__ #define __stpcpy(dest, src) (__extension__ (__builtin_constant_p (src) ? (__string2_1bptr_p (src) && strlen (src) +...
This does not change any types. It just makes implicit conversions explicit. Here's the warnings in question for reference: ``` /mnt/s/GitHub/simplecpp-fw/simplecpp.cpp:401:76: warning: implicit conversion loses integer precision: 'int' to 'const...
I tested the following source file: ``` #include #define __SAMC21N18A__ #define SAM_PART_IS_DEFINED(part) (defined(__ ## part ## __)) #define SAM SAM_PART_IS_DEFINED(SAMC21N18A) int main() { #if SAM printf("Hello World"); #endif return 0;...
```cpp #define foo(intp)f##oo(intp foo(f##oo(intp)) ``` ``` ==200327== at 0x129A34: __gnu_cxx::__aligned_membuf::_M_addr() (aligned_buffer.h:65) ==200327== by 0x129A24: __gnu_cxx::__aligned_membuf::_M_ptr() (aligned_buffer.h:73) ==200327== by 0x1297A8: std::_Rb_tree_node::_M_valptr() (stl_tree.h:235) ==200327== by 0x129664: std::_Rb_tree_node* std::_Rb_tree::_M_clone_node(std::_Rb_tree_node*, std::_Rb_tree::_Alloc_node&) (stl_tree.h:647) ==200327== by...
```cpp #include #include ``` ``` ==58215==ERROR: LeakSanitizer: detected memory leaks Direct leak of 144 byte(s) in 2 object(s) allocated from: #0 0x7ff948ae2002 in operator new(unsigned long) /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_new_delete> #1 0x56404715371a in...
```cpp #/**/include ``` ``` simplecpp.cpp:3436:66: runtime error: member access within null pointer of type 'const Token' #0 0x61489cfd2109 in simplecpp::preprocess(simplecpp::TokenList&, simplecpp::TokenList const&, std::__1::vector&, std::__1::map&, simplecpp::DUI const&, std::__1::list*, std::__1::list*, std::__1::list*) /home/user/CLionProjects/simplecpp-rider/simplecpp.cpp:3436:66...