[Ada] Lower severity of the program's return value in some common cases
Arnaud Charlet
charlet@adacore.com
Fri Nov 7 14:00:00 GMT 2014
In some common use cases, gnatls used to return E_Fatal error code, which was
unfriendly for analysis. It has been changed as follows:
"gnatls -v" and default runtime exists, or
"gnatls -v --RTS=<good runtime path>" - now returns E_Success
"gnatls -v" and no default runtime exists - now returns E_Warnings
"gnatls", "gnatls -h" - now returns E_Success
Tested on x86_64-pc-linux-gnu, committed on trunk
2014-11-07 Vasiliy Fofanov <fofanov@adacore.com>
* gnatls.adb: Lower severity of the program's return value in
some common cases.
-------------- next part --------------
Index: gnatls.adb
===================================================================
--- gnatls.adb (revision 217215)
+++ gnatls.adb (working copy)
@@ -1663,6 +1663,7 @@
("Default runtime not available. Use --RTS= with a valid runtime");
Write_Eol;
Write_Eol;
+ Exit_Status := E_Warnings;
end if;
Write_Str ("Source Search Path:");
@@ -1775,10 +1776,11 @@
Usage;
else
Try_Help;
+ Exit_Status := E_Fatal;
end if;
end if;
- Exit_Program (E_Fatal);
+ Exit_Program (Exit_Status);
end if;
Initialize_ALI;
More information about the Gcc-patches
mailing list