EiffelStudio 19.11 highlights: warnings as errors

by Alexander Kogtenkov (modified: 2019 Jun 27)

Software is evolving. Even the best libraries and projects change over time to support new functionality, to reflect modifications in the code they depend on, or to fix bugs or inconsistencies. How to ensure none of your changes or changes in third-party libraries cause an unnoticed degradation, especially when using automated builds?

With EiffelStudio 19.11, a project can specify 3 levels of severity for warnings reported by the compiler: none, warning, error. The first two levels correspond to the setting enabling or disabling warning detection in previous versions of the environment. The last one turns warnings into errors. With this setting, the build fails if the compiler reports any warning.

The required value is set in the project settings dialog for targets, clusters and even classes, though the latter is rarely needed. By default (i.e. the value is not specified directly or indirectly), warnings are detected and reported as warnings. Specific checks can be enabled and disabled individually.

In many cases a warning message does not imply a definite bug and could be a false alarm instead, but the checks can detect a real bug. For example, the conditional if attached x /= Void then is reported as violating VWEQ, and turns out to be a buggy translation of if x /= Void then into if attached x then As usual, Eiffel Software team is the first user of the new functionality. All code in the directory library of the installation has been updated to take advantage of the strictest setting - "report warnings as errors". Early adopters can try it with EiffelStudio 19.06 beta release.