Patchwork [Ada] gnatmake does not take into account compiler switch -gnatknn

login
register
mail settings
Submitter Arnaud Charlet
Date June 22, 2010, 5:18 p.m.
Message ID <20100622171810.GA30827@adacore.com>
Download mbox | patch
Permalink /patch/56539/
State New
Headers show

Comments

Arnaud Charlet - June 22, 2010, 5:18 p.m.
When the gnatmake switch -s is used, all Ada sources are recompiled even
if they are up to date, when the compiler is invoked with -gnatknn.
This patch fixes this.
The test for this is to invoke twice in a row
   gnatmake -s main.adb -cargs -gnatk99
There should be no recompilation for the second invocation.

Tested on x86_64-pc-linux-gnu, committed on trunk

2010-06-22  Vincent Celier  <celier@adacore.com>

	* switch-m.adb (Normalize_Compiler_Switches): Process correctly
	switches -gnatknn.

Patch

Index: switch-m.adb
===================================================================
--- switch-m.adb	(revision 161186)
+++ switch-m.adb	(working copy)
@@ -215,10 +215,10 @@  package body Switch.M is
 
                   --  One-letter switches
 
-                  when 'a' | 'A' | 'b' | 'c' | 'D' | 'E' | 'f' |
-                    'F' | 'g' | 'h' | 'H' | 'k' | 'l' | 'L' | 'n' | 'N' |
-                    'o' | 'O' | 'p' | 'P' | 'q' | 'Q' | 'r' | 's' | 't' |
-                    'u' | 'U' | 'v' | 'x' | 'X' | 'Z' =>
+                  when 'a' | 'A' | 'b' | 'c' | 'D' | 'E' | 'f' | 'F' |
+                       'g' | 'h' | 'H' | 'l' | 'L' | 'n' | 'N' | 'o' |
+                       'O' | 'p' | 'P' | 'q' | 'Q' | 'r' | 's' | 't' |
+                       'u' | 'U' | 'v' | 'x' | 'X' | 'Z' =>
                      Storing (First_Stored) := C;
                      Add_Switch_Component
                        (Storing (Storing'First .. First_Stored));
@@ -226,7 +226,7 @@  package body Switch.M is
 
                   --  One-letter switches followed by a positive number
 
-                  when 'm' | 'T' =>
+                  when 'k' | 'm' | 'T' =>
                      Storing (First_Stored) := C;
                      Last_Stored := First_Stored;