Skip to content
Snippets Groups Projects
Commit 39e183a6 authored by Piotr Trojanek's avatar Piotr Trojanek Committed by Marc Poulhiès
Browse files

ada: Leave detection of missing return in functions to GNATprove

GNAT has a heuristic to warn about missing return statements in
functions. This warning was escalated to errors when operating in
GNATprove mode and SPARK_Mode was On. However, this heuristic was
imprecise and caused spurious errors. Also, it was applied after the
Push_Scope/End_Scope, so for functions acting as compilation units it
was using the wrong SPARK_Mode.

It is better to simply leave this detection to GNATprove.

gcc/ada/

	* sem_ch6.adb (Check_Statement_Sequence): Only warn about missing return
	statements and let GNATprove emit a check when needed.
parent 5d8fc020
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment