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

Makefile silent when addone function doesn't exist #134

Open
pennyan opened this issue Jul 18, 2022 · 5 comments
Open

Makefile silent when addone function doesn't exist #134

pennyan opened this issue Jul 18, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@pennyan
Copy link

pennyan commented Jul 18, 2022

When addone function is not defined but used in UNWINDSET like below:
UNWINDSET += somefunction.0:$(call addone,$(SOME_LEN))
The Makefile won't generate an error, instead I observe that the proof will not terminate. I'm guessing it is because the unwinding level is treated as infinite and CBMC just keeps unwinding the loop.

It will be nicer if an error is generated saying addone is not defined. Or another fix is to add the addone definition into the Makefiles generated by cbmc-started-kit, since it is probably needed for loop unwinding proofs.

@tautschnig
Copy link
Member

We could ponder adding MAKEFLAGS=--warn-undefined-variables to Makefile.common, but I'm not sure whether this would break anything. (Perhaps you could give make --warn-undefined-variables a try, which accomplishes the same, just on the command line?)

@pennyan
Copy link
Author

pennyan commented Jul 20, 2022

I tried make --warn-undefined-variables with both addone defined and not defined. In the case addone is defined, the proof is successful. In the case it is not defined, I do get several warnings about undefined variable addone. So it seems like adding that flag won't break anything (in the single case I tried).

The only problem is that, the output is not user friendly. First there already exists variables in Makefile.common that are not defined, so those get reported too. Second, each occurrence of an undefined variable gets a warning. So I got a ton of repeated ones.

@markrtuttle
Copy link
Contributor

What is addone? Is this a Makefile macro that you would like to define? A reasonable place to put this definition would be in the Makefile-project-defines.

@jimgrundy
Copy link
Contributor

Let's use this as an example in the training material of something that would be useful to add to the makefile project defines.

@feliperodri feliperodri added the bug Something isn't working label Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants