function Is_Valid_Path_Name (Name : String) return Boolean is
Start : Positive := Name'First;
Last : Natural;
+
begin
-- A path name cannot be empty, cannot contain more than 256 characters,
-- cannot contain invalid characters and each directory/file name need
--------------------------
function Is_Valid_Simple_Name (Name : String) return Boolean is
- Only_Spaces : Boolean := True;
+ Only_Spaces : Boolean;
+
begin
-- A file name cannot be empty, cannot contain more than 256 characters,
-- and cannot contain invalid characters, including '\'
if Name'Length = 0 or else Name'Length > 256 then
return False;
+ -- Name length is OK
+
else
+ Only_Spaces := True;
for J in Name'Range loop
if Invalid_Character (Name (J)) or else Name (J) = '\' then
return False;
-
elsif Name (J) /= ' ' then
Only_Spaces := False;
end if;
end loop;
- end if;
- -- If Name follows the rules, it is valid
+ -- If no invalid chars, and not all spaces, file name is valid.
- return not Only_Spaces;
+ return not Only_Spaces;
+ end if;
end Is_Valid_Simple_Name;
end Ada.Directories.Validity;
+2004-04-06 Pascal Obry <obry@gnat.com>
+
+ * adaint.c (DIR_SEPARATOR): Properly set DIR_SEPARATOR on Win32.
+
+ * osint.adb (Program_Name): Do not look past a directory separator.
+
+2004-04-06 Thomas Quinot <quinot@act-europe.fr>
+
+ * atree.adb: Update comment (Rewrite_Substitute_Node no longer exists).
+
+ * exp_ch6.adb (Rewrite_Function_Call): Clarify documentation of
+ requirement for preserving a copy of the original assignment node.
+
+ * sinfo.ads: Update comment (Original_Tree -> Original_Node).
+
+2004-04-06 Olivier Hainque <hainque@act-europe.fr>
+
+ (__gnat_initialize [Vxworks]): Enable references to the crtstuff bits
+ when supported.
+
+2004-04-06 Ed Schonberg <schonberg@gnat.com>
+
+ * sem_ch4.adb (Remove_Abstract_Operations): Extend previous changes to
+ operator calls in functional notation, and apply
+ Universal_Interpretation to operands, not to their type.
+
+2004-04-06 Robert Dewar <dewar@gnat.com>
+
+ * 5wdirval.adb: Minor reformatting
+
+2004-04-06 Ed Falis <falis@gnat.com>
+
+ * gnat_rm.texi: Improve a reference to the GCC manual
+
2004-04-05 Vincent Celier <celier@gnat.com>
* adaint.h, adaint.c: Add function __gnat_named_file_length
#if defined (_WIN32)
#include <dir.h>
#include <windows.h>
+#undef DIR_SEPARATOR
+#define DIR_SEPARATOR '\\'
#endif
#include "adaint.h"
{
return 3;
}
-
-- Since we are doing a replace, we assume that the original node
-- is intended to become the new replaced node. The call would be
- -- to Rewrite_Substitute_Node if there were an intention to save
- -- the original node.
+ -- to Rewrite if there were an intention to save the original node.
Orig_Nodes.Table (Old_Node) := Old_Node;
-- complete assignment subtree consistent enough for
-- Analyze_Assignment to proceed. We do not use the
-- saved value, the point was just to do the relocation.
+ -- We cannot rely on Original_Node to go back from the
+ -- block node to the assignment node, because the
+ -- assignment might already be a rewrite substitution.
begin
Rewrite (Original_Assignment, Blk);
@noindent
GNAT, The GNU Ada 95 Compiler@*
-Version for GCC @value{version-GCC}@*
+GCC version @value{version-GCC}@*
@noindent
Ada Core Technologies, Inc.
@end itemize
@noindent
-The two features are similar, and both closely related to the mechanism
+The two features are similar, and both are closely related to the mechanism
provided by the asm instruction in the GNU C compiler. Full understanding
and use of the facilities in this package requires understanding the asm
-instruction as described in
-@cite{Using and Porting the GNU Compiler Collection (GCC)} by Richard
-Stallman. Calls to the function @code{Asm} and the procedure @code{Asm}
-have identical semantic restrictions and effects as described below.
-Both are provided so that the procedure call can be used as a statement,
-and the function call can be used to form a code_statement.
+instruction as described in @cite{Using the GNU Compiler Collection (GCC)}
+by Richard Stallman. The relevant section is titled ``Extensions to the C
+Language Family'' -> ``Assembler Instructions with C Expression Operands''.
+
+Calls to the function @code{Asm} and the procedure @code{Asm} have identical
+semantic restrictions and effects as described below. Both are provided so
+that the procedure call can be used as a statement, and the function call
+can be used to form a code_statement.
The first example given in the GCC documentation is the C @code{asm}
instruction:
call the appropriate function here. We'll never unload that, so there is
no de-registration to worry about.
- We can differentiate between the two cases by looking at the
- __module_has_ctors value provided by each class of crt objects. As of
- today, selecting the crt set intended for applications to be statically
- linked with the kernel is triggered by adding "-static" to the gcc *link*
- command line options. */
+ We can differentiate by looking at the __module_has_ctors value provided
+ by each class of crt objects. As of today, selecting the crt set intended
+ for applications to be statically linked with the kernel is triggered by
+ adding "-static" to the gcc *link* command line options.
-#if 0
+ This is a first approach, tightly synchronized with a number of GCC
+ configuration and crtstuff changes. We need to ensure that those changes
+ are there to activate this circuitry. */
+
+#if DWARF2_UNWIND_INFO && defined (_ARCH_PPC)
{
extern const int __module_has_ctors;
extern void __do_global_ctors ();
-- "alpha-dec-vxworks-"
while Name_Len > 0 loop
+
+ -- All done if we find the last hyphen
+
if Name_Buffer (Name_Len) = '-' then
exit;
+
+ -- If directory separator found, we don't want to look further
+ -- since in this case, no prefix has been found.
+
+ elsif Is_Directory_Separator (Name_Buffer (Name_Len)) then
+ Name_Len := 0;
+ exit;
end if;
Name_Len := Name_Len - 1;
-- always added to the overload set, unless it is a universal
-- operation.
- if Nkind (N) in N_Op
- and then Has_Abstract_Op
- then
+ if not Has_Abstract_Op then
+ return;
+
+ elsif Nkind (N) in N_Op then
if Nkind (N) in N_Unary_Op
- and then
- Present (Universal_Interpretation (Etype (Right_Opnd (N))))
+ and then Present (Universal_Interpretation (Right_Opnd (N)))
then
return;
elsif Nkind (N) in N_Binary_Op
- and then
- Present (Universal_Interpretation (Etype (Right_Opnd (N))))
- and then
- Present (Universal_Interpretation (Etype (Left_Opnd (N))))
+ and then Present (Universal_Interpretation (Right_Opnd (N)))
+ and then Present (Universal_Interpretation (Left_Opnd (N)))
then
return;
Get_Next_Interp (I, It);
end loop;
end if;
+
+ elsif Nkind (N) = N_Function_Call
+ and then
+ (Nkind (Name (N)) = N_Operator_Symbol
+ or else
+ (Nkind (Name (N)) = N_Expanded_Name
+ and then
+ Nkind (Selector_Name (Name (N))) = N_Operator_Symbol))
+ then
+ declare
+ Arg1 : constant Node_Id := First (Parameter_Associations (N));
+
+ begin
+ if Present (Universal_Interpretation (Arg1))
+ or else
+ (Present (Next (Arg1))
+ and then
+ Present (Universal_Interpretation (Next (Arg1))))
+ then
+ return;
+
+ else
+ Get_First_Interp (N, I, It);
+ while Present (It.Nam) loop
+ if Scope (It.Nam) = Standard_Standard then
+ Remove_Interp (I);
+ end if;
+
+ Get_Next_Interp (I, It);
+ end loop;
+ end if;
+ end;
end if;
end if;
end Remove_Abstract_Operations;
-- stub. During the analysis procedure, stubs in some situations
-- get rewritten by the corresponding bodies, and we set this flag
-- to remember that this happened. Note that it is not good enough
- -- to rely on the use of Original_Tree here because of the case of
+ -- to rely on the use of Original_Node here because of the case of
-- nested instantiations where the substituted node can be copied.
-- Zero_Cost_Handling (Flag5-Sem)