PR# 19930 ecf assertions can't be selectively turned off

Problem Report Summary
Submitter: brotherbill
Category: Compiler
Priority: Low
Date: 2024/06/23
Class: Support
Severity: Non-critical
Number: 19930
Release: 24.05
Confidential: No
Status: Analyzed
Responsible:
Environment: win
Synopsis: ecf assertions can't be selectively turned off

Description
Added a nonsense precondition to gcd routine in GCD_EXAMPLES: require a_negative: a < 0.
If ecf file has ALL assertions turned off, it properly ignores the nonsense precondition.
If supplier_precondition = "true" and all other assertions are "false", the precondition is tested and is violated at run time.

Question 1: What is the purpose of <option warning="true">  vs. <option warning="false"> ?
Question 2: Shouldn't each assertion violation checking be independent of the others?
Question 3: Why should supplier_precondition="true" and "precondition="false" violate the precondition?
To Reproduce
Execute the application.
Problem Report Interactions
From:jfiat_es    Date:2024/06/26    Status: Analyzed    Download   
I agree this is not clear and the logic would be to have precondition checked only for libraries.

We will check the implementation.

From:brotherbill    Date:2024/06/26    Status: Open    Download   
I would expect that if supplier_precondition = "true" and all other preconditions are false, that my failing preconditions should be ignored.

Please reproduce this.

From:jfiat_es    Date:2024/06/26    Status: Closed    Download   
> Added a nonsense precondition to gcd routine in GCD_EXAMPLES: require a_negative: a < 0.
> If ecf file has ALL assertions turned off, it properly ignores the nonsense precondition.
> If supplier_precondition = "true" and all other assertions are "false", the precondition is tested and is violated at run time.

See https://www.eiffel.org/doc/eiffelstudio/Assertion_Options 

> Question 1: What is the purpose of <option warning="true">  vs. <option warning="false"> ?
compiler warning can be reported (True), ignored (False), and in recent ECF schema, there is also the possibility to consider compiler warnings as "error". This is when you want strict policy and accept no warning at all (i.e: all warnings have to be fixed to get a successful compilation).
See in the project settings Target > Advanced > Warnings > Warning

> Question 2: Shouldn't each assertion violation checking be independent of the others?
I am not sure to get your question correctly, as for now, you can set assertion as you want for
....
Output truncated, Click download to get the full message

From:brotherbill    Date:2024/06/23    Download   
Attachments for problem report #19930

Attachment: p387-388.zip     Size:1623