public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Library_Dir incorrectly reported as not declared
@ 2011-08-02 10:14 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2011-08-02 10:14 UTC (permalink / raw)
  To: gcc-patches; +Cc: Vincent Celier

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

For qualified library project, when attribute Library_Name was not
declared, but attribute Library_Dir was, both attributes were reported
as not declared.
The test for this is to have a qualified library project with Library_Dir
declared and Library_Name not declared. There should be no error message
for Library_Dir not declared.

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

2011-08-02  Vincent Celier  <celier@adacore.com>

	* prj-nmsc.adb (Check_Library_Attributes): Do not report Library_Dir
	not declared for qualified library project when Library_Name is not
	declared, but Library_Dir is.


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

Index: prj-nmsc.adb
===================================================================
--- prj-nmsc.adb	(revision 177107)
+++ prj-nmsc.adb	(working copy)
@@ -3915,17 +3915,23 @@
 
             when Library =>
                if not Project.Library then
-                  if Project.Library_Dir = No_Path_Information then
+                  if Project.Library_Name = No_Name then
                      Error_Msg
                        (Data.Flags,
-                        "\attribute Library_Dir not declared",
+                        "attribute Library_Name not declared",
                         Project.Location, Project);
-                  end if;
 
-                  if Project.Library_Name = No_Name then
+                     if not Library_Directory_Present then
+                        Error_Msg
+                          (Data.Flags,
+                           "\attribute Library_Dir not declared",
+                           Project.Location, Project);
+                     end if;
+
+                  elsif Project.Library_Dir = No_Path_Information then
                      Error_Msg
                        (Data.Flags,
-                        "\attribute Library_Name not declared",
+                        "attribute Library_Dir not declared",
                         Project.Location, Project);
                   end if;
                end if;

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

only message in thread, other threads:[~2011-08-02 10:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-02 10:14 [Ada] Library_Dir incorrectly reported as not declared 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).