with Hostparm;
with Namet; use Namet;
with Osint; use Osint;
with Output; use Output;
with System.WCh_Con; use System.WCh_Con;
procedure Usage is
procedure Write_Switch_Char (Sw : String; Prefix : String := "gnat");
procedure Write_Switch_Char (Sw : String; Prefix : String := "gnat") is
begin
Write_Str (" -");
Write_Str (Prefix);
Write_Str (Sw);
for J in 1 .. 12 - 3 - Prefix'Length - Sw'Length loop
Write_Char (' ');
end loop;
end Write_Switch_Char;
begin
Find_Program_Name;
if Name_Len >= 8
and then (Name_Buffer (Name_Len - 7 .. Name_Len) = "gnatmake"
or else
Name_Buffer (Name_Len - 7 .. Name_Len) = "GNATMAKE")
then
Write_Eol;
Write_Line ("Compiler switches (passed to the compiler by gnatmake):");
else
Write_Str ("Usage: ");
Write_Program_Name;
Write_Char (' ');
Write_Str ("switches sfile");
Write_Eol;
Write_Eol;
Write_Line (" sfile Source file name");
end if;
Write_Eol;
if not Hostparm.Java_VM then
Write_Switch_Char ("fstack-check ", "");
Write_Line ("Generate stack checking code");
Write_Switch_Char ("fno-inline ", "");
Write_Line ("Inhibit all inlining (makes executable smaller)");
end if;
Write_Switch_Char ("g ", "");
Write_Line ("Generate debugging information");
Write_Switch_Char ("Idir ", "");
Write_Line ("Specify source files search path");
Write_Switch_Char ("I- ", "");
Write_Line ("Do not look for sources in current directory");
Write_Switch_Char ("O[0123] ", "");
Write_Line ("Control the optimization level");
Write_Eol;
Write_Switch_Char ("a");
Write_Line ("Assertions enabled. Pragma Assert/Debug to be activated");
Write_Switch_Char ("A");
Write_Line ("Avoid processing gnat.adc, if present file will be ignored");
Write_Switch_Char ("b");
Write_Line ("Generate brief messages to stderr even if verbose mode set");
Write_Switch_Char ("c");
Write_Line ("Check syntax and semantics only (no code generation)");
Write_Switch_Char ("C");
Write_Line ("Compress names in external names and debug info tables");
Write_Switch_Char ("d?");
Write_Line ("Compiler debug option ? (a-z,A-Z,0-9), see debug.adb");
Write_Switch_Char ("D");
Write_Line ("Debug expanded generated code rather than source code");
Write_Switch_Char ("ec?");
Write_Line ("Specify configuration pragmas file, e.g. -gnatec/x/f.adc");
Write_Switch_Char ("em?");
Write_Line ("Specify mapping file, e.g. -gnatemmapping");
Write_Switch_Char ("E");
Write_Line ("Dynamic elaboration checking mode enabled");
Write_Switch_Char ("f");
Write_Line ("Full errors. Verbose details, all undefined references");
Write_Switch_Char ("F");
Write_Line ("Force all import/export external names to all uppercase");
Write_Switch_Char ("g");
Write_Line ("GNAT implementation mode (used for compiling GNAT units)");
Write_Switch_Char ("G");
Write_Line ("Output generated expanded code in source form");
Write_Switch_Char ("h");
Write_Line ("Output this usage (help) information");
Write_Switch_Char ("i?");
Write_Line ("Identifier char set (?=1/2/3/4/5/8/9/p/f/n/w)");
Write_Switch_Char ("k");
Write_Line ("Limit file names to nnn characters (k = krunch)");
Write_Switch_Char ("l");
Write_Line ("Output full source listing with embedded error messages");
Write_Switch_Char ("L");
Write_Line ("Use longjmp/setjmp for exception handling");
Write_Switch_Char ("mnnn");
Write_Line ("Limit number of detected errors to nnn (1-999)");
Write_Switch_Char ("n");
Write_Line ("Inlining of subprograms (apply pragma Inline across units)");
Write_Switch_Char ("N");
Write_Line ("Full (frontend) inlining of subprograqms");
Write_Switch_Char ("o");
Write_Line ("Enable overflow checking (off by default)");
Write_Switch_Char ("O nm ");
Write_Line ("Set name of output ali file (internal switch)");
Write_Switch_Char ("p");
Write_Line ("Suppress all checks");
Write_Switch_Char ("P");
Write_Line ("Generate periodic calls to System.Polling.Poll");
Write_Switch_Char ("q");
Write_Line ("Don't quit, try semantics, even if parse errors");
Write_Switch_Char ("Q");
Write_Line ("Don't quit, write ali/tree file even if compile errors");
Write_Switch_Char ("R?");
Write_Line ("List rep inf (?=0/1/2/3 for none/types/all/variable)");
Write_Switch_Char ("s");
Write_Line ("Syntax check only");
Write_Switch_Char ("t");
Write_Line ("Tree output file to be generated");
Write_Switch_Char ("Tnnn");
Write_Line ("All compiler tables start at nnn times usual starting size");
Write_Switch_Char ("u");
Write_Line ("List units for this compilation");
Write_Switch_Char ("U");
Write_Line ("Enable unique tag for error messages");
Write_Switch_Char ("v");
Write_Line ("Verbose mode. Full error output with source lines to stdout");
Write_Switch_Char ("Vxx");
Write_Line
("Enable selected validity checking mode, xx = list of parameters:");
Write_Line (" a turn on all validity checking options");
Write_Line (" c turn on checking for copies");
Write_Line (" C turn off checking for copies");
Write_Line (" d turn on default (RM) checking");
Write_Line (" D turn off default (RM) checking");
Write_Line (" f turn on checking for floating-point");
Write_Line (" F turn off checking for floating-point");
Write_Line (" i turn on checking for in params");
Write_Line (" I turn off checking for in params");
Write_Line (" m turn on checking for in out params");
Write_Line (" M turn off checking for in out params");
Write_Line (" o turn on checking for operators/attributes");
Write_Line (" O turn off checking for operators/attributes");
Write_Line (" r turn on checking for returns");
Write_Line (" R turn off checking for returns");
Write_Line (" s turn on checking for subscripts");
Write_Line (" S turn off checking for subscripts");
Write_Line (" t turn on checking for tests");
Write_Line (" T turn off checking for tests");
Write_Line (" n turn off all validity checks (including RM)");
Write_Switch_Char ("wxx");
Write_Line ("Enable selected warning modes, xx = list of parameters:");
Write_Line (" a turn on all optional warnings (except b,d,h)");
Write_Line (" A turn off all optional warnings");
Write_Line (" b turn on biased rounding warnings");
Write_Line (" B turn off biased rounding warnings");
Write_Line (" c turn on constant conditional warnings");
Write_Line (" C* turn off constant conditional warnings");
Write_Line (" d turn on implicit dereference warnings");
Write_Line (" D* turn off implicit dereference warnings");
Write_Line (" e treat all warnings as errors");
Write_Line (" f turn on unreferenced formal warnings");
Write_Line (" F* turn off unreferenced formal warnings");
Write_Line (" h turn on warnings for hiding variables");
Write_Line (" H* turn off warnings for hiding variables");
Write_Line (" i* turn on warnings for implementation units");
Write_Line (" I turn off warnings for implementation units");
Write_Line (" l turn on elaboration warnings");
Write_Line (" L* turn off elaboration warnings");
Write_Line (" o* turn on address clause overlay warnings");
Write_Line (" O turn off address clause overlay warnings");
Write_Line (" p turn on warnings for ineffective pragma inline");
Write_Line (" P* turn off warnings for ineffective pragma inline");
Write_Line (" r turn on redundant construct warnings");
Write_Line (" R* turn off redundant construct warnings");
Write_Line (" s suppress all warnings");
Write_Line (" u turn on warnings for unused entities");
Write_Line (" U* turn off warnings for unused entities");
Write_Line (" * indicates default in above list");
Write_Switch_Char ("W");
Write_Str ("Wide character encoding method (");
for J in WC_Encoding_Method loop
Write_Char (WC_Encoding_Letters (J));
if J = WC_Encoding_Method'Last then
Write_Char (')');
else
Write_Char ('/');
end if;
end loop;
Write_Eol;
Write_Switch_Char ("x");
Write_Line ("Suppress output of cross-reference information");
Write_Switch_Char ("X");
Write_Line ("Language extensions permitted");
Write_Switch_Char ("y");
Write_Line ("Enable all style checks except 'o', indent=3");
Write_Switch_Char ("yxx");
Write_Line ("Enable selected style checks xx = list of parameters:");
Write_Line (" 1-9 check indentation");
Write_Line (" a check attribute casing");
Write_Line (" b check no blanks at end of lines");
Write_Line (" c check comment format");
Write_Line (" e check end/exit labels present");
Write_Line (" f check no form feeds/vertical tabs in source");
Write_Line (" h check no horizontal tabs in source");
Write_Line (" i check if-then layout");
Write_Line (" k check casing rules for keywords, identifiers");
Write_Line (" l check reference manual layout");
Write_Line (" m check line length <= 79 characters");
Write_Line (" n check casing of package Standard identifiers");
Write_Line (" Mnnn check line length <= nnn characters");
Write_Line (" o check subprogram bodies in alphabetical order");
Write_Line (" p check pragma casing");
Write_Line (" r check RM column layout");
Write_Line (" s check separate subprogram specs present");
Write_Line (" t check token separation rules");
Write_Switch_Char ("z");
Write_Line ("Distribution stub generation (r/s for receiver/sender stubs)");
Write_Switch_Char ("Z");
Write_Line ("Use zero cost exception handling");
Write_Switch_Char ("83");
Write_Line ("Enforce Ada 83 restrictions");
end Usage;