DeadCodeProductions / dead

Other
50 stars 5 forks source link

Preprocessing fix #19

Closed Quarub closed 2 years ago

Quarub commented 2 years ago

Addresses #18.

This is not a perfect solution as we remove some functions that might be used by the program, leading to another implicit declaration. However, for CSmith programs it seems to work.

In case it doesn't work anymore for some use-case, we could add -Wno-implicit-function-declaration in builder.get_asm_str, thereby bypassing everything.

thetheodor commented 2 years ago

Also, I think we should make it a convention everytime we add/change some code to include a relevant test case (or cases), like this one: https://github.com/DeadCodeProductions/diopter/blob/diopter/test/test_constant_globals.py

and we should also add pytest to CI

thetheodor commented 2 years ago

This is much easier to read/understand, thanks!

Can you also add a few test cases under /test/test_preprocessing.py?

Quarub commented 2 years ago

I added a test, but it is in the main directory as we can't do relative imports yet as dead is not yet a package.