public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] gnat check -o output fails
@ 2009-11-30 14:01 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2009-11-30 14:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: Vincent Celier

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

When "gnat check" is invoked with switch -o followed by a file name,
but with no other file name on the command line, gnatcheck complains
that there is no input source file. This patch ensures that in this
case, all the sources of the project are passed to gnatcheck.
The problem occurs also for gnatpp switches -o and -of and for
gnatmetric switches -o, -og, -ox and -d.
The test for this is to invoke
   gnat check -P <project file> -o <output file>
There should not be an error "gnatcheck: No input source file set".

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

2009-11-30  Vincent Celier  <celier@adacore.com>

	* gnatcmd.adb (Check_Files): Recognize documented switches that have a
	separate parameter.


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 1458 bytes --]

Index: gnatcmd.adb
===================================================================
--- gnatcmd.adb	(revision 154755)
+++ gnatcmd.adb	(working copy)
@@ -318,8 +318,31 @@ procedure GNATCmd is
 
       for Index in 1 .. Last_Switches.Last loop
          if Last_Switches.Table (Index) (1) /= '-' then
-            Add_Sources := False;
-            exit;
+            if Index = 1
+              or else
+                (The_Command = Check
+                   and then
+                     Last_Switches.Table (Index - 1).all /= "-o")
+              or else
+                (The_Command = Pretty
+                   and then
+                     Last_Switches.Table (Index - 1).all /= "-o"  and then
+                     Last_Switches.Table (Index - 1).all /= "-of")
+              or else
+                (The_Command = Metric
+                   and then
+                     Last_Switches.Table (Index - 1).all /= "-o"  and then
+                     Last_Switches.Table (Index - 1).all /= "-og" and then
+                     Last_Switches.Table (Index - 1).all /= "-ox" and then
+                     Last_Switches.Table (Index - 1).all /= "-d")
+              or else
+                (The_Command /= Check  and then
+                 The_Command /= Pretty and then
+                 The_Command /= Metric)
+            then
+               Add_Sources := False;
+               exit;
+            end if;
          end if;
       end loop;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-30 13:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-30 14:01 [Ada] gnat check -o output fails Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).