Question: In this assignment, we have to create a directory with several C + + programs that demonstrate certain features, as well as a makefile that

In this assignment, we have to create a directory with several C++ programs that demonstrate certain features, as well as a makefile that shows how they can be diagnosed.
Part 1: Create a program that uses a divide-by-zero behavior that would be caught at runtime by the ubsan module. Add two Makefile targets, one that forces the behavior to be reported at runtime, and one that allows the behavior to go unchecked.
Part 2: Create a program that uses an out-ofbounds behavior that would be caught at runtime by the memsan or asan module. Add two Makefile targets for the same program, one that forces the behavior to be reported at runtime, and one that allows the behavior to go unchecked.
Part 3: Create a program that uses a behavior that could be statically detected and cause an error in the compiler. Add two Makefile targets, one that rejects the program (i.e. will not compile it) and one that will compile the program without complaint.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!