Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: how can I test for arithmetic overflow #16

Open
matu3ba opened this issue Dec 30, 2021 · 3 comments
Open

question: how can I test for arithmetic overflow #16

matu3ba opened this issue Dec 30, 2021 · 3 comments
Labels

Comments

@matu3ba
Copy link
Contributor

matu3ba commented Dec 30, 2021

Is there even a simple way to macro overload arithmetic expressions to auto-insert overflow checks ie via
SEI Standard https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152052 ?

Alternatively documentation how to emit the instructions for testing with clang/gcc would be great.

@jasmcaus
Copy link
Owner

Not quite sure that Tau's at that level yet. It's really meant to be a basic-yet-powerful testing library, but some features might not be available. Have a look at it and see if it's something you can contribute to :)

@matu3ba
Copy link
Contributor Author

matu3ba commented Apr 11, 2022

The best we can do is to give some advice on the compiler flags, as such macro system would end up being a template language.
Alternatively, we can look for a c++ template implementation, but this would mean potential maintenance annoyance.

other stuff:

  • valgrind
  • -Weverything + orientation how to select a sane subset of warnings.
  • something like -Wcast-align being utterly useless (breaks on pointer cast *u8->*u32), -Wformat being annoying on address printing in wiki page. Casting pointers from lower to higher alignment is UB and more optimization tailored compilers will introduce weird behavior (clang, gcc) unless given a flag.
  • setup for testing in REPL / test-driven development

@jasmcaus
Copy link
Owner

I'm going to defer this for a later stage.

@jasmcaus jasmcaus added the todo label Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants