Commit fce68ebe by Arnaud Charlet

[multiple changes]

2013-04-11  Robert Dewar  <dewar@adacore.com>

	* sem_prag.adb, prj-env.adb: Minor reformatting.

2013-04-11  Ben Brosgol  <brosgol@adacore.com>

	* gnat_ugn.texi: Clean ups.

2013-04-11  Yannick Moy  <moy@adacore.com>

	* set_targ.adb: Minor comment update.

From-SVN: r197798
parent e2441021
2013-04-11 Robert Dewar <dewar@adacore.com>
* sem_prag.adb, prj-env.adb: Minor reformatting.
2013-04-11 Ben Brosgol <brosgol@adacore.com>
* gnat_ugn.texi: Clean ups.
2013-04-11 Yannick Moy <moy@adacore.com>
* set_targ.adb: Minor comment update.
2013-04-11 Pascal Obry <obry@adacore.com> 2013-04-11 Pascal Obry <obry@adacore.com>
* gnat_ugn.texi: Remove obsolete comment about DLL calling * gnat_ugn.texi: Remove obsolete comment about DLL calling
......
...@@ -169,9 +169,9 @@ AdaCore@* ...@@ -169,9 +169,9 @@ AdaCore@*
* About This Guide:: * About This Guide::
* Getting Started with GNAT:: * Getting Started with GNAT::
* The GNAT Compilation Model:: * The GNAT Compilation Model::
* Compiling Using gcc:: * Compiling With gcc::
* Binding Using gnatbind:: * Binding With gnatbind::
* Linking Using gnatlink:: * Linking With gnatlink::
* The GNAT Make Program gnatmake:: * The GNAT Make Program gnatmake::
* Improving Performance:: * Improving Performance::
* Renaming Files Using gnatchop:: * Renaming Files Using gnatchop::
...@@ -198,10 +198,10 @@ AdaCore@* ...@@ -198,10 +198,10 @@ AdaCore@*
* Performing Dimensionality Analysis in GNAT:: * Performing Dimensionality Analysis in GNAT::
* Generating Ada Bindings for C and C++ headers:: * Generating Ada Bindings for C and C++ headers::
* Other Utility Programs:: * Other Utility Programs::
* Running and Debugging Ada Programs::
@ifclear vms @ifclear vms
* Code Coverage and Profiling:: * Code Coverage and Profiling::
@end ifclear @end ifclear
* Running and Debugging Ada Programs::
@ifset vms @ifset vms
* Compatibility with HP Ada:: * Compatibility with HP Ada::
@end ifset @end ifset
...@@ -217,17 +217,15 @@ AdaCore@* ...@@ -217,17 +217,15 @@ AdaCore@*
* GNU Free Documentation License:: * GNU Free Documentation License::
* Index:: * Index::
--- The Detailed Node Listing --- --- Detailed Contents ---
About This Guide About This Guide
* What This Guide Contains:: * What This Guide Contains::
* What You Should Know before Reading This Guide:: * What You Should Know before Reading This Guide::
* Related Information:: * Related Information::
* Conventions:: * Conventions::
Getting Started with GNAT Getting Started with GNAT
* Running GNAT:: * Running GNAT::
* Running a Simple Ada Program:: * Running a Simple Ada Program::
* Running a Program with Multiple Units:: * Running a Program with Multiple Units::
...@@ -240,7 +238,6 @@ Getting Started with GNAT ...@@ -240,7 +238,6 @@ Getting Started with GNAT
@end ifclear @end ifclear
The GNAT Compilation Model The GNAT Compilation Model
* Source Representation:: * Source Representation::
* Foreign Language Representation:: * Foreign Language Representation::
* File Naming Rules:: * File Naming Rules::
...@@ -260,67 +257,25 @@ The GNAT Compilation Model ...@@ -260,67 +257,25 @@ The GNAT Compilation Model
* Placement of temporary files:: * Placement of temporary files::
@end ifset @end ifset
Foreign Language Representation Compiling With gcc
* Latin-1::
* Other 8-Bit Codes::
* Wide Character Encodings::
Compiling Ada Programs With gcc
* Compiling Programs:: * Compiling Programs::
* Switches for gcc:: * Switches for gcc::
* Search Paths and the Run-Time Library (RTL):: * Search Paths and the Run-Time Library (RTL)::
* Order of Compilation Issues:: * Order of Compilation Issues::
* Examples:: * Examples::
Switches for gcc Binding With gnatbind
* Output and Error Message Control::
* Warning Message Control::
* Debugging and Assertion Control::
* Validity Checking::
* Style Checking::
* Run-Time Checks::
* Using gcc for Syntax Checking::
* Using gcc for Semantic Checking::
* Compiling Different Versions of Ada::
* Character Set Control::
* File Naming Control::
* Subprogram Inlining Control::
* Auxiliary Output Control::
* Debugging Control::
* Exception Handling Control::
* Units to Sources Mapping Files::
* Integrated Preprocessing::
@ifset vms
* Return Codes::
@end ifset
Binding Ada Programs With gnatbind
* Running gnatbind:: * Running gnatbind::
* Switches for gnatbind:: * Switches for gnatbind::
* Command-Line Access:: * Command-Line Access::
* Search Paths for gnatbind:: * Search Paths for gnatbind::
* Examples of gnatbind Usage:: * Examples of gnatbind Usage::
Switches for gnatbind Linking With gnatlink
* Consistency-Checking Modes::
* Binder Error Message Control::
* Elaboration Control::
* Output Control::
* Binding with Non-Ada Main Programs::
* Binding Programs with No Main Subprogram::
Linking Using gnatlink
* Running gnatlink:: * Running gnatlink::
* Switches for gnatlink:: * Switches for gnatlink::
The GNAT Make Program gnatmake The GNAT Make Program gnatmake
* Running gnatmake:: * Running gnatmake::
* Switches for gnatmake:: * Switches for gnatmake::
* Mode Switches for gnatmake:: * Mode Switches for gnatmake::
...@@ -334,33 +289,7 @@ Improving Performance ...@@ -334,33 +289,7 @@ Improving Performance
* Reducing Size of Ada Executables with gnatelim:: * Reducing Size of Ada Executables with gnatelim::
* Reducing Size of Executables with unused subprogram/data elimination:: * Reducing Size of Executables with unused subprogram/data elimination::
Performance Considerations
* Controlling Run-Time Checks::
* Use of Restrictions::
* Optimization Levels::
* Debugging Optimized Code::
* Inlining of Subprograms::
* Vectorization of loops::
* Other Optimization Switches::
* Optimization and Strict Aliasing::
@ifset vms
* Coverage Analysis::
@end ifset
Reducing Size of Ada Executables with gnatelim
* About gnatelim::
* Running gnatelim::
* Processing Precompiled Libraries::
* Correcting the List of Eliminate Pragmas::
* Making Your Executables Smaller::
* Summary of the gnatelim Usage Cycle::
Reducing Size of Executables with unused subprogram/data elimination
* About unused subprogram/data elimination::
* Compilation options::
Renaming Files Using gnatchop Renaming Files Using gnatchop
* Handling Files with Multiple Units:: * Handling Files with Multiple Units::
* Operating gnatchop in Compilation Mode:: * Operating gnatchop in Compilation Mode::
* Command Line for gnatchop:: * Command Line for gnatchop::
...@@ -368,19 +297,34 @@ Renaming Files Using gnatchop ...@@ -368,19 +297,34 @@ Renaming Files Using gnatchop
* Examples of gnatchop Usage:: * Examples of gnatchop Usage::
Configuration Pragmas Configuration Pragmas
* Handling of Configuration Pragmas:: * Handling of Configuration Pragmas::
* The Configuration Pragmas Files:: * The Configuration Pragmas Files::
Handling Arbitrary File Naming Conventions Using gnatname Handling Arbitrary File Naming Conventions Using gnatname
* Arbitrary File Naming Conventions:: * Arbitrary File Naming Conventions::
* Running gnatname:: * Running gnatname::
* Switches for gnatname:: * Switches for gnatname::
* Examples of gnatname Usage:: * Examples of gnatname Usage::
The Cross-Referencing Tools gnatxref and gnatfind GNAT Project Manager
* Introduction::
* Building With Projects::
* Organizing Projects into Subsystems::
* Scenarios in Projects::
* Library Projects::
* Project Extension::
* Aggregate Projects::
* Aggregate Library Projects::
* Project File Reference::
Tools Supporting Project Files
* Switches Related to Project Files::
* Switches and Project Files::
* Specifying Configuration Pragmas::
* Project Files and Main Subprograms::
* Library Project Files::
The Cross-Referencing Tools gnatxref and gnatfind
* Switches for gnatxref:: * Switches for gnatxref::
* Switches for gnatfind:: * Switches for gnatfind::
* Project Files for gnatxref and gnatfind:: * Project Files for gnatxref and gnatfind::
...@@ -389,16 +333,13 @@ The Cross-Referencing Tools gnatxref and gnatfind ...@@ -389,16 +333,13 @@ The Cross-Referencing Tools gnatxref and gnatfind
* Examples of gnatfind Usage:: * Examples of gnatfind Usage::
The GNAT Pretty-Printer gnatpp The GNAT Pretty-Printer gnatpp
* Switches for gnatpp:: * Switches for gnatpp::
* Formatting Rules:: * Formatting Rules::
The GNAT Metrics Tool gnatmetric The GNAT Metrics Tool gnatmetric
* Switches for gnatmetric:: * Switches for gnatmetric::
File Name Krunching Using gnatkr File Name Krunching Using gnatkr
* About gnatkr:: * About gnatkr::
* Using gnatkr:: * Using gnatkr::
* Krunching Method:: * Krunching Method::
...@@ -412,28 +353,23 @@ Preprocessing Using gnatprep ...@@ -412,28 +353,23 @@ Preprocessing Using gnatprep
* Form of Input Text for gnatprep:: * Form of Input Text for gnatprep::
The GNAT Library Browser gnatls The GNAT Library Browser gnatls
* Running gnatls:: * Running gnatls::
* Switches for gnatls:: * Switches for gnatls::
* Examples of gnatls Usage:: * Examples of gnatls Usage::
Cleaning Up Using gnatclean Cleaning Up Using gnatclean
* Running gnatclean:: * Running gnatclean::
* Switches for gnatclean:: * Switches for gnatclean::
@c * Examples of gnatclean Usage:: @c * Examples of gnatclean Usage::
@ifclear vms @ifclear vms
GNAT and Libraries GNAT and Libraries
* Introduction to Libraries in GNAT:: * Introduction to Libraries in GNAT::
* General Ada Libraries:: * General Ada Libraries::
* Stand-alone Ada Libraries:: * Stand-alone Ada Libraries::
* Rebuilding the GNAT Run-Time Library:: * Rebuilding the GNAT Run-Time Library::
Using the GNU make Utility Using the GNU make Utility
* Using gnatmake in a Makefile:: * Using gnatmake in a Makefile::
* Automatically Creating a List of Directories:: * Automatically Creating a List of Directories::
* Generating the Command Line Switches:: * Generating the Command Line Switches::
...@@ -441,7 +377,6 @@ Using the GNU make Utility ...@@ -441,7 +377,6 @@ Using the GNU make Utility
@end ifclear @end ifclear
Memory Management Issues Memory Management Issues
* Some Useful Memory Pools:: * Some Useful Memory Pools::
* The GNAT Debug Pool Facility:: * The GNAT Debug Pool Facility::
@ifclear vms @ifclear vms
...@@ -449,20 +384,17 @@ Memory Management Issues ...@@ -449,20 +384,17 @@ Memory Management Issues
@end ifclear @end ifclear
Stack Related Facilities Stack Related Facilities
* Stack Overflow Checking:: * Stack Overflow Checking::
* Static Stack Usage Analysis:: * Static Stack Usage Analysis::
* Dynamic Stack Usage Analysis:: * Dynamic Stack Usage Analysis::
Verifying Properties Using gnatcheck Verifying Properties Using gnatcheck
Sample Bodies Using gnatstub Creating Sample Bodies Using gnatstub
* Running gnatstub:: * Running gnatstub::
* Switches for gnatstub:: * Switches for gnatstub::
Creating Unit Tests Using gnattest Creating Unit Tests Using gnattest
* Running gnattest:: * Running gnattest::
* Switches for gnattest:: * Switches for gnattest::
* Project Attributes for gnattest:: * Project Attributes for gnattest::
...@@ -480,21 +412,30 @@ Creating Unit Tests Using gnattest ...@@ -480,21 +412,30 @@ Creating Unit Tests Using gnattest
@end ifclear @end ifclear
* Current Limitations:: * Current Limitations::
Other Utility Programs Performing Dimensionality Analysis in GNAT
Generating Ada Bindings for C and C++ headers
* Running the binding generator::
* Generating bindings for C++ headers::
* Switches::
Other Utility Programs
* Using Other Utility Programs with GNAT:: * Using Other Utility Programs with GNAT::
* The External Symbol Naming Scheme of GNAT:: * The External Symbol Naming Scheme of GNAT::
* Converting Ada Files to html with gnathtml:: * Converting Ada Files to html with gnathtml::
* Installing gnathtml::
@ifset vms
* LSE::
* Profiling::
@end ifset
@ifclear vms @ifclear vms
Code Coverage and Profiling Code Coverage and Profiling
* Code Coverage of Ada Programs using gcov:: * Code Coverage of Ada Programs using gcov::
* Profiling an Ada Program using gprof:: * Profiling an Ada Program using gprof::
@end ifclear @end ifclear
Running and Debugging Ada Programs Running and Debugging Ada Programs
* The GNAT Debugger GDB:: * The GNAT Debugger GDB::
* Running GDB:: * Running GDB::
* Introduction to GDB Commands:: * Introduction to GDB Commands::
...@@ -511,12 +452,7 @@ Running and Debugging Ada Programs ...@@ -511,12 +452,7 @@ Running and Debugging Ada Programs
* Stack Traceback:: * Stack Traceback::
@ifset vms @ifset vms
* LSE::
@end ifset
@ifset vms
Compatibility with HP Ada Compatibility with HP Ada
* Ada Language Compatibility:: * Ada Language Compatibility::
* Differences in the Definition of Package System:: * Differences in the Definition of Package System::
* Language-Related Features:: * Language-Related Features::
...@@ -535,7 +471,6 @@ Compatibility with HP Ada ...@@ -535,7 +471,6 @@ Compatibility with HP Ada
* Tools and Utilities:: * Tools and Utilities::
Language-Related Features Language-Related Features
* Integer Types and Representations:: * Integer Types and Representations::
* Floating-Point Types and Representations:: * Floating-Point Types and Representations::
* Pragmas Float_Representation and Long_Float:: * Pragmas Float_Representation and Long_Float::
...@@ -545,7 +480,6 @@ Language-Related Features ...@@ -545,7 +480,6 @@ Language-Related Features
* Other Representation Clauses:: * Other Representation Clauses::
Tasking and Task-Related Features Tasking and Task-Related Features
* Implementation of Tasks in HP Ada for OpenVMS Alpha Systems:: * Implementation of Tasks in HP Ada for OpenVMS Alpha Systems::
* Assigning Task IDs:: * Assigning Task IDs::
* Task IDs and Delays:: * Task IDs and Delays::
...@@ -555,23 +489,19 @@ Tasking and Task-Related Features ...@@ -555,23 +489,19 @@ Tasking and Task-Related Features
* External Interrupts:: * External Interrupts::
Pragmas and Pragma-Related Features Pragmas and Pragma-Related Features
* Restrictions on the Pragma INLINE:: * Restrictions on the Pragma INLINE::
* Restrictions on the Pragma INTERFACE:: * Restrictions on the Pragma INTERFACE::
* Restrictions on the Pragma SYSTEM_NAME:: * Restrictions on the Pragma SYSTEM_NAME::
Library of Predefined Units Library of Predefined Units
* Changes to DECLIB:: * Changes to DECLIB::
Bindings Bindings
* Shared Libraries and Options Files:: * Shared Libraries and Options Files::
* Interfaces to C:: * Interfaces to C::
@end ifset @end ifset
Platform-Specific Information for the Run-Time Libraries Platform-Specific Information for the Run-Time Libraries
* Summary of Run-Time Configurations:: * Summary of Run-Time Configurations::
* Specifying a Run-Time Library:: * Specifying a Run-Time Library::
* Choosing the Scheduling Policy:: * Choosing the Scheduling Policy::
...@@ -584,7 +514,6 @@ Platform-Specific Information for the Run-Time Libraries ...@@ -584,7 +514,6 @@ Platform-Specific Information for the Run-Time Libraries
Example of Binder Output File Example of Binder Output File
Elaboration Order Handling in GNAT Elaboration Order Handling in GNAT
* Elaboration Code:: * Elaboration Code::
* Checking the Elaboration Order:: * Checking the Elaboration Order::
* Controlling the Elaboration Order:: * Controlling the Elaboration Order::
...@@ -614,7 +543,6 @@ Conditional Compilation ...@@ -614,7 +543,6 @@ Conditional Compilation
* Preprocessing:: * Preprocessing::
Inline Assembler Inline Assembler
* Basic Assembler Syntax:: * Basic Assembler Syntax::
* A Simple Example of Inline Assembler:: * A Simple Example of Inline Assembler::
* Output Variables in Inline Assembler:: * Output Variables in Inline Assembler::
...@@ -623,7 +551,6 @@ Inline Assembler ...@@ -623,7 +551,6 @@ Inline Assembler
* Other Asm Functionality:: * Other Asm Functionality::
Compatibility and Porting Guide Compatibility and Porting Guide
* Compatibility with Ada 83:: * Compatibility with Ada 83::
* Compatibility between Ada 95 and Ada 2005:: * Compatibility between Ada 95 and Ada 2005::
* Implementation-dependent characteristics:: * Implementation-dependent characteristics::
...@@ -639,7 +566,6 @@ Compatibility and Porting Guide ...@@ -639,7 +566,6 @@ Compatibility and Porting Guide
@end ifset @end ifset
Microsoft Windows Topics Microsoft Windows Topics
@ifclear FSFEDITION @ifclear FSFEDITION
* Installing from the Command Line:: * Installing from the Command Line::
@end ifclear @end ifclear
...@@ -658,10 +584,11 @@ Microsoft Windows Topics ...@@ -658,10 +584,11 @@ Microsoft Windows Topics
* Setting Heap Size from gnatlink:: * Setting Heap Size from gnatlink::
Mac OS Topics Mac OS Topics
* Codesigning the Debugger:: * Codesigning the Debugger::
* Index:: GNU Free Documentation License
Index
@end menu @end menu
@end ifnottex @end ifnottex
...@@ -723,16 +650,16 @@ and running Ada programs with the GNAT Ada programming environment. ...@@ -723,16 +650,16 @@ and running Ada programs with the GNAT Ada programming environment.
by GNAT. by GNAT.
@item @item
@ref{Compiling Using gcc}, describes how to compile @ref{Compiling With gcc}, describes how to compile
Ada programs with @command{gcc}, the Ada compiler. Ada programs with @command{gcc}, the Ada compiler.
@item @item
@ref{Binding Using gnatbind}, describes how to @ref{Binding With gnatbind}, describes how to
perform binding of Ada programs with @code{gnatbind}, the GNAT binding perform binding of Ada programs with @code{gnatbind}, the GNAT binding
utility. utility.
@item @item
@ref{Linking Using gnatlink}, @ref{Linking With gnatlink},
describes @command{gnatlink}, a describes @command{gnatlink}, a
program that provides for linking using the GNAT run-time library to program that provides for linking using the GNAT run-time library to
construct a program. @command{gnatlink} can also incorporate foreign language construct a program. @command{gnatlink} can also incorporate foreign language
...@@ -3798,8 +3725,8 @@ GNAT uses the current directory for temporary files. ...@@ -3798,8 +3725,8 @@ GNAT uses the current directory for temporary files.
@end ifset @end ifset
@c ************************* @c *************************
@node Compiling Using gcc @node Compiling With gcc
@chapter Compiling Using @command{gcc} @chapter Compiling With @command{gcc}
@noindent @noindent
This chapter discusses how to compile Ada programs using the @command{gcc} This chapter discusses how to compile Ada programs using the @command{gcc}
...@@ -7088,7 +7015,7 @@ on subprogram calls and generic instantiations. ...@@ -7088,7 +7015,7 @@ on subprogram calls and generic instantiations.
Note that @option{-gnatE} is not necessary for safety, because in the Note that @option{-gnatE} is not necessary for safety, because in the
default mode, GNAT ensures statically that the checks would not fail. default mode, GNAT ensures statically that the checks would not fail.
For full details of the effect and use of this switch, For full details of the effect and use of this switch,
@xref{Compiling Using gcc}. @xref{Compiling With gcc}.
@item -fstack-check @item -fstack-check
@cindex @option{-fstack-check} (@command{gcc}) @cindex @option{-fstack-check} (@command{gcc})
...@@ -8280,8 +8207,8 @@ Compile the subunit in file @file{abc-def.adb} in semantic-checking-only ...@@ -8280,8 +8207,8 @@ Compile the subunit in file @file{abc-def.adb} in semantic-checking-only
mode. mode.
@end table @end table
@node Binding Using gnatbind @node Binding With gnatbind
@chapter Binding Using @code{gnatbind} @chapter Binding With @code{gnatbind}
@findex gnatbind @findex gnatbind
@menu @menu
...@@ -9276,8 +9203,8 @@ since gnatlink will not be able to find the generated file. ...@@ -9276,8 +9203,8 @@ since gnatlink will not be able to find the generated file.
@end table @end table
@c ------------------------------------ @c ------------------------------------
@node Linking Using gnatlink @node Linking With gnatlink
@chapter Linking Using @command{gnatlink} @chapter Linking With @command{gnatlink}
@c ------------------------------------ @c ------------------------------------
@findex gnatlink @findex gnatlink
...@@ -29729,6 +29656,12 @@ end API; ...@@ -29729,6 +29656,12 @@ end API;
@end group @end group
@end smallexample @end smallexample
@noindent
Note that a variable is
@strong{always imported with a DLL convention}. A function
can have @code{C} or @code{Stdcall} convention.
(@pxref{Windows Calling Conventions}).
@node Creating an Import Library @node Creating an Import Library
@subsection Creating an Import Library @subsection Creating an Import Library
@cindex Import library @cindex Import library
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with Fmap; with Fmap;
with Hostparm; with Hostparm;
with Makeutl; use Makeutl; with Makeutl; use Makeutl;
...@@ -35,6 +33,8 @@ with Prj.Com; use Prj.Com; ...@@ -35,6 +33,8 @@ with Prj.Com; use Prj.Com;
with Sdefault; with Sdefault;
with Tempdir; with Tempdir;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Directory_Operations; use GNAT.Directory_Operations; with GNAT.Directory_Operations; use GNAT.Directory_Operations;
package body Prj.Env is package body Prj.Env is
......
...@@ -401,9 +401,8 @@ package body Sem_Prag is ...@@ -401,9 +401,8 @@ package body Sem_Prag is
Error_Msg_Name_2 := Name_Class; Error_Msg_Name_2 := Name_Class;
Error_Msg_N Error_Msg_N
("aspect `%''%` can only be specified for a primitive " & ("aspect `%''%` can only be specified for a primitive "
"operation of a tagged type", & "operation of a tagged type", Corresponding_Aspect (N));
Corresponding_Aspect (N));
end if; end if;
Replace_Type (Get_Pragma_Arg (Arg1)); Replace_Type (Get_Pragma_Arg (Arg1));
...@@ -1430,8 +1429,8 @@ package body Sem_Prag is ...@@ -1430,8 +1429,8 @@ package body Sem_Prag is
and then not Is_Unchecked_Union (Etype (Subtype_Mark (Sindic))) and then not Is_Unchecked_Union (Etype (Subtype_Mark (Sindic)))
then then
Error_Msg_N Error_Msg_N
("component subtype subject to per-object constraint " & ("component subtype subject to per-object constraint "
"must be an Unchecked_Union", Comp); & "must be an Unchecked_Union", Comp);
-- Ada 2012 (AI05-0026): For an unchecked union type declared within -- Ada 2012 (AI05-0026): For an unchecked union type declared within
-- the body of a generic unit, or within the body of any of its -- the body of a generic unit, or within the body of any of its
...@@ -1948,12 +1947,12 @@ package body Sem_Prag is ...@@ -1948,12 +1947,12 @@ package body Sem_Prag is
begin begin
if Nkind (Constr) = N_Pragma then if Nkind (Constr) = N_Pragma then
Error_Pragma Error_Pragma
("pragma % must appear immediately within the statements " & ("pragma % must appear immediately within the statements "
"of a loop"); & "of a loop");
else else
Error_Pragma_Arg Error_Pragma_Arg
("block containing pragma % must appear immediately within " & ("block containing pragma % must appear immediately within "
"the statements of a loop", Constr); & "the statements of a loop", Constr);
end if; end if;
end Placement_Error; end Placement_Error;
...@@ -3482,9 +3481,8 @@ package body Sem_Prag is ...@@ -3482,9 +3481,8 @@ package body Sem_Prag is
and then C /= Convention (Overridden_Operation (E)) and then C /= Convention (Overridden_Operation (E))
then then
Error_Pragma_Arg Error_Pragma_Arg
("cannot change convention for " & ("cannot change convention for overridden "
"overridden dispatching operation", & "dispatching operation", Arg1);
Arg1);
end if; end if;
-- Set the convention -- Set the convention
...@@ -4796,8 +4794,8 @@ package body Sem_Prag is ...@@ -4796,8 +4794,8 @@ package body Sem_Prag is
then then
Error_Msg_Sloc := Sloc (Def_Id); Error_Msg_Sloc := Sloc (Def_Id);
Error_Msg_NE Error_Msg_NE
("cannot import&, renaming already provided for " & ("cannot import&, renaming already provided for "
"declaration #", N, Def_Id); & "declaration #", N, Def_Id);
end if; end if;
end; end;
...@@ -6878,8 +6876,8 @@ package body Sem_Prag is ...@@ -6878,8 +6876,8 @@ package body Sem_Prag is
(not Input_Seen and then not Output_Seen)) -- none (not Input_Seen and then not Output_Seen)) -- none
then then
Error_Msg_N Error_Msg_N
("property Volatile requires exactly one Input or " & ("property Volatile requires exactly one Input or "
"Output", State); & "Output", State);
end if; end if;
-- Either Input or Output require Volatile -- Either Input or Output require Volatile
...@@ -7606,8 +7604,7 @@ package body Sem_Prag is ...@@ -7606,8 +7604,7 @@ package body Sem_Prag is
-- unit (RM E.4.1(4)). -- unit (RM E.4.1(4)).
Error_Pragma Error_Pragma
("pragma% not in Remote_Call_Interface or " & ("pragma% not in Remote_Call_Interface or Remote_Types unit");
"Remote_Types unit");
end if; end if;
if Ekind (Nm) = E_Procedure if Ekind (Nm) = E_Procedure
...@@ -8238,8 +8235,8 @@ package body Sem_Prag is ...@@ -8238,8 +8235,8 @@ package body Sem_Prag is
and then not Is_Array_Type (Typ) and then not Is_Array_Type (Typ)
then then
Error_Pragma_Arg Error_Pragma_Arg
("Name parameter of pragma% must identify record or " & ("Name parameter of pragma% must identify record or "
"array type", Name); & "array type", Name);
end if; end if;
-- An explicit Component_Alignment pragma overrides an -- An explicit Component_Alignment pragma overrides an
...@@ -8525,10 +8522,9 @@ package body Sem_Prag is ...@@ -8525,10 +8522,9 @@ package body Sem_Prag is
GNAT_Pragma; GNAT_Pragma;
if Warn_On_Obsolescent_Feature then if Warn_On_Obsolescent_Feature then
-- Following message is obsolete ???
Error_Msg_N Error_Msg_N
("'G'N'A'T pragma cpp'_class is now obsolete and has no " & ("'G'N'A'T pragma cpp'_class is now obsolete and has no "
"effect; replace it by pragma import?j?", N); & "effect; replace it by pragma import?j?", N);
end if; end if;
Check_Arg_Count (1); Check_Arg_Count (1);
...@@ -8591,8 +8587,8 @@ package body Sem_Prag is ...@@ -8591,8 +8587,8 @@ package body Sem_Prag is
then then
if Scope (Def_Id) /= Scope (Etype (Def_Id)) then if Scope (Def_Id) /= Scope (Etype (Def_Id)) then
Error_Msg_N Error_Msg_N
("'C'P'P constructor must be defined in the scope of " & ("'C'P'P constructor must be defined in the scope of "
"its returned type", Arg1); & "its returned type", Arg1);
end if; end if;
if Arg_Count >= 2 then if Arg_Count >= 2 then
...@@ -8652,8 +8648,8 @@ package body Sem_Prag is ...@@ -8652,8 +8648,8 @@ package body Sem_Prag is
if Warn_On_Obsolescent_Feature then if Warn_On_Obsolescent_Feature then
Error_Msg_N Error_Msg_N
("'G'N'A'T pragma cpp'_virtual is now obsolete and has " & ("'G'N'A'T pragma cpp'_virtual is now obsolete and has "
"no effect?j?", N); & "no effect?j?", N);
end if; end if;
end CPP_Virtual; end CPP_Virtual;
...@@ -8667,8 +8663,8 @@ package body Sem_Prag is ...@@ -8667,8 +8663,8 @@ package body Sem_Prag is
if Warn_On_Obsolescent_Feature then if Warn_On_Obsolescent_Feature then
Error_Msg_N Error_Msg_N
("'G'N'A'T pragma cpp'_vtable is now obsolete and has " & ("'G'N'A'T pragma cpp'_vtable is now obsolete and has "
"no effect?j?", N); & "no effect?j?", N);
end if; end if;
end CPP_Vtable; end CPP_Vtable;
...@@ -9071,8 +9067,8 @@ package body Sem_Prag is ...@@ -9071,8 +9067,8 @@ package body Sem_Prag is
then then
Error_Msg_Name_1 := Name_Result; Error_Msg_Name_1 := Name_Result;
Error_Msg_N Error_Msg_N
("prefix of attribute % must denote the enclosing " & ("prefix of attribute % must denote the enclosing "
"function", Item); & "function", Item);
-- Function'Result is allowed to appear on the output -- Function'Result is allowed to appear on the output
-- side of a dependency clause. -- side of a dependency clause.
...@@ -9096,8 +9092,8 @@ package body Sem_Prag is ...@@ -9096,8 +9092,8 @@ package body Sem_Prag is
if Is_Output and then not Is_Last then if Is_Output and then not Is_Last then
Error_Msg_N Error_Msg_N
("null output list must be the last clause in " & ("null output list must be the last clause in "
"a dependency relation", Item); & "a dependency relation", Item);
end if; end if;
end if; end if;
...@@ -9142,8 +9138,8 @@ package body Sem_Prag is ...@@ -9142,8 +9138,8 @@ package body Sem_Prag is
and then Contains (All_Inputs_Seen, Item_Id) and then Contains (All_Inputs_Seen, Item_Id)
then then
Error_Msg_N Error_Msg_N
("input of a null output list appears in " & ("input of a null output list appears in "
"multiple input lists", Item); & "multiple input lists", Item);
else else
if No (All_Inputs_Seen) then if No (All_Inputs_Seen) then
All_Inputs_Seen := New_Elmt_List; All_Inputs_Seen := New_Elmt_List;
...@@ -9165,16 +9161,16 @@ package body Sem_Prag is ...@@ -9165,16 +9161,16 @@ package body Sem_Prag is
else else
Error_Msg_N Error_Msg_N
("item must denote variable, state or formal " & ("item must denote variable, state or formal "
"parameter", Item); & "parameter", Item);
end if; end if;
-- All other input/output items are illegal -- All other input/output items are illegal
else else
Error_Msg_N Error_Msg_N
("item must denote variable, state or formal " & ("item must denote variable, state or formal "
"parameter", Item); & "parameter", Item);
end if; end if;
end if; end if;
end Analyze_Input_Output; end Analyze_Input_Output;
...@@ -10047,8 +10043,8 @@ package body Sem_Prag is ...@@ -10047,8 +10043,8 @@ package body Sem_Prag is
Present (Source_Location) Present (Source_Location)
then then
Error_Pragma Error_Pragma
("parameter profile and source location cannot " & ("parameter profile and source location cannot "
"be used together in pragma%"); & "be used together in pragma%");
end if; end if;
Process_Eliminate_Pragma Process_Eliminate_Pragma
...@@ -10904,8 +10900,8 @@ package body Sem_Prag is ...@@ -10904,8 +10900,8 @@ package body Sem_Prag is
if Ekind (Item_Id) = E_Abstract_State if Ekind (Item_Id) = E_Abstract_State
and then Is_Volatile_State (Item_Id) and then Is_Volatile_State (Item_Id)
then then
-- A global item of mode In_Out or Output cannot denote a -- A global item of mode In_Out or Output cannot denote
-- volatile Input state. -- a volatile Input state.
if Is_Input_State (Item_Id) if Is_Input_State (Item_Id)
and then (Global_Mode = Name_In_Out and then (Global_Mode = Name_In_Out
...@@ -10913,8 +10909,8 @@ package body Sem_Prag is ...@@ -10913,8 +10909,8 @@ package body Sem_Prag is
Global_Mode = Name_Output) Global_Mode = Name_Output)
then then
Error_Msg_N Error_Msg_N
("global item of mode In_Out or Output cannot " & ("global item of mode In_Out or Output cannot "
"reference Volatile Input state", Item); & "reference Volatile Input state", Item);
-- A global item of mode In_Out or Input cannot reference -- A global item of mode In_Out or Input cannot reference
-- a volatile Output state. -- a volatile Output state.
...@@ -11316,8 +11312,8 @@ package body Sem_Prag is ...@@ -11316,8 +11312,8 @@ package body Sem_Prag is
null; null;
else else
Error_Pragma_Arg Error_Pragma_Arg
("controlling formal must be of synchronized " & ("controlling formal must be of synchronized "
"tagged type", Arg1); & "tagged type", Arg1);
return; return;
end if; end if;
...@@ -11345,8 +11341,8 @@ package body Sem_Prag is ...@@ -11345,8 +11341,8 @@ package body Sem_Prag is
and then Is_Task_Interface (Typ) and then Is_Task_Interface (Typ)
then then
Error_Pragma_Arg Error_Pragma_Arg
("implementation kind By_Protected_Procedure cannot be " & ("implementation kind By_Protected_Procedure cannot be "
"applied to a task interface primitive", Arg2); & "applied to a task interface primitive", Arg2);
return; return;
end if; end if;
...@@ -12168,8 +12164,8 @@ package body Sem_Prag is ...@@ -12168,8 +12164,8 @@ package body Sem_Prag is
Int_Val > Expr_Value (Type_High_Bound (Int_Id)) Int_Val > Expr_Value (Type_High_Bound (Int_Id))
then then
Error_Pragma_Arg Error_Pragma_Arg
("value not in range of type " & ("value not in range of type "
"""Ada.Interrupts.Interrupt_'I'D""", Arg1); & """Ada.Interrupts.Interrupt_'I'D""", Arg1);
end if; end if;
end if; end if;
...@@ -12275,8 +12271,8 @@ package body Sem_Prag is ...@@ -12275,8 +12271,8 @@ package body Sem_Prag is
elsif In_Private_Part (Current_Scope) then elsif In_Private_Part (Current_Scope) then
Error_Pragma_Arg Error_Pragma_Arg
("pragma% only allowed for private type " & ("pragma% only allowed for private type "
"declared in visible part", Arg1); & "declared in visible part", Arg1);
else else
Error_Pragma_Arg Error_Pragma_Arg
...@@ -12369,12 +12365,12 @@ package body Sem_Prag is ...@@ -12369,12 +12365,12 @@ package body Sem_Prag is
if Ekind (Def_Id) /= E_Function then if Ekind (Def_Id) /= E_Function then
if VM_Target = JVM_Target then if VM_Target = JVM_Target then
Error_Pragma_Arg Error_Pragma_Arg
("pragma% requires function returning a " & ("pragma% requires function returning a "
"'Java access type", Def_Id); & "'Java access type", Def_Id);
else else
Error_Pragma_Arg Error_Pragma_Arg
("pragma% requires function returning a " & ("pragma% requires function returning a "
"'C'I'L access type", Def_Id); & "'C'I'L access type", Def_Id);
end if; end if;
end if; end if;
...@@ -12470,8 +12466,8 @@ package body Sem_Prag is ...@@ -12470,8 +12466,8 @@ package body Sem_Prag is
then then
Error_Msg_Name_1 := Pname; Error_Msg_Name_1 := Pname;
Error_Msg_N Error_Msg_N
("first formal of % function must be a named access" & ("first formal of % function must be a named access "
" to subprogram type", & "to subprogram type",
Parameter_Type (Parent (This_Formal))); Parameter_Type (Parent (This_Formal)));
-- Warning: We should reject anonymous access types because -- Warning: We should reject anonymous access types because
...@@ -12487,9 +12483,8 @@ package body Sem_Prag is ...@@ -12487,9 +12483,8 @@ package body Sem_Prag is
then then
Error_Msg_Name_1 := Pname; Error_Msg_Name_1 := Pname;
Error_Msg_N Error_Msg_N
("first formal of % function must be a named access" & ("first formal of % function must be a named access "
" type", & " type", Parameter_Type (Parent (This_Formal)));
Parameter_Type (Parent (This_Formal)));
elsif Atree.Convention elsif Atree.Convention
(Designated_Type (Etype (This_Formal))) /= Convention (Designated_Type (Etype (This_Formal))) /= Convention
...@@ -12498,14 +12493,12 @@ package body Sem_Prag is ...@@ -12498,14 +12493,12 @@ package body Sem_Prag is
if Convention = Convention_Java then if Convention = Convention_Java then
Error_Msg_N Error_Msg_N
("pragma% requires convention 'Cil in designated" & ("pragma% requires convention 'Cil in designated "
" type", & "type", Parameter_Type (Parent (This_Formal)));
Parameter_Type (Parent (This_Formal)));
else else
Error_Msg_N Error_Msg_N
("pragma% requires convention 'Java in designated" & ("pragma% requires convention 'Java in designated "
" type", & "type", Parameter_Type (Parent (This_Formal)));
Parameter_Type (Parent (This_Formal)));
end if; end if;
elsif No (Expression (Parent (This_Formal))) elsif No (Expression (Parent (This_Formal)))
...@@ -12534,13 +12527,13 @@ package body Sem_Prag is ...@@ -12534,13 +12527,13 @@ package body Sem_Prag is
if Atree.Convention (Etype (Def_Id)) /= Convention then if Atree.Convention (Etype (Def_Id)) /= Convention then
if Convention = Convention_Java then if Convention = Convention_Java then
Error_Pragma_Arg Error_Pragma_Arg
("pragma% requires function returning a " & ("pragma% requires function returning a "
"'Java access type", Arg1); & "'Java access type", Arg1);
else else
pragma Assert (Convention = Convention_CIL); pragma Assert (Convention = Convention_CIL);
Error_Pragma_Arg Error_Pragma_Arg
("pragma% requires function returning a " & ("pragma% requires function returning a "
"'C'I'L access type", Arg1); & "'C'I'L access type", Arg1);
end if; end if;
end if; end if;
...@@ -12555,12 +12548,12 @@ package body Sem_Prag is ...@@ -12555,12 +12548,12 @@ package body Sem_Prag is
if Convention = Convention_Java then if Convention = Convention_Java then
Error_Pragma_Arg Error_Pragma_Arg
("pragma% requires function returning a named" & ("pragma% requires function returning a named "
"'Java access type", Arg1); & "'Java access type", Arg1);
else else
Error_Pragma_Arg Error_Pragma_Arg
("pragma% requires function returning a named" & ("pragma% requires function returning a named "
"'C'I'L access type", Arg1); & "'C'I'L access type", Arg1);
end if; end if;
end if; end if;
end if; end if;
...@@ -13585,8 +13578,8 @@ package body Sem_Prag is ...@@ -13585,8 +13578,8 @@ package body Sem_Prag is
loop loop
if No (Ent) then if No (Ent) then
Error_Pragma Error_Pragma
("pragma % entity name does not match any " & ("pragma % entity name does not match any "
"enumeration literal"); & "enumeration literal");
elsif Chars (Ent) = Chars (Ename) then elsif Chars (Ent) = Chars (Ename) then
Set_Entity (Ename, Ent); Set_Entity (Ename, Ent);
...@@ -14154,8 +14147,8 @@ package body Sem_Prag is ...@@ -14154,8 +14147,8 @@ package body Sem_Prag is
and then not Has_Preelaborable_Initialization (Ent) and then not Has_Preelaborable_Initialization (Ent)
then then
Error_Msg_N Error_Msg_N
("protected type & does not have preelaborable " & ("protected type & does not have preelaborable "
"initialization", Ent); & "initialization", Ent);
-- Otherwise mark the type as definitely having preelaborable -- Otherwise mark the type as definitely having preelaborable
-- initialization. -- initialization.
...@@ -14614,8 +14607,8 @@ package body Sem_Prag is ...@@ -14614,8 +14607,8 @@ package body Sem_Prag is
elsif Lower_Val > Upper_Val then elsif Lower_Val > Upper_Val then
Error_Pragma Error_Pragma
("last_priority_expression must be greater than" & ("last_priority_expression must be greater than "
" or equal to first_priority_expression"); & "or equal to first_priority_expression");
-- Store the new policy, but always preserve System_Location since -- Store the new policy, but always preserve System_Location since
-- we like the error message with the run-time name. -- we like the error message with the run-time name.
...@@ -15457,8 +15450,8 @@ package body Sem_Prag is ...@@ -15457,8 +15450,8 @@ package body Sem_Prag is
or else In_Package_Body (Current_Scope) or else In_Package_Body (Current_Scope)
then then
Error_Pragma Error_Pragma
("pragma% can only apply to type declared immediately " & ("pragma% can only apply to type declared immediately"
"within a package declaration"); & " within a package declaration");
end if; end if;
-- A simple storage pool type must be an immutably limited record -- A simple storage pool type must be an immutably limited record
...@@ -15696,8 +15689,8 @@ package body Sem_Prag is ...@@ -15696,8 +15689,8 @@ package body Sem_Prag is
or else Present (Next_Formal (First_Formal (Ent))) or else Present (Next_Formal (First_Formal (Ent)))
then then
Error_Pragma_Arg Error_Pragma_Arg
("argument for pragma% must be" & ("argument for pragma% must be function of one argument",
" function of one argument", Arg); Arg);
end if; end if;
end Check_OK_Stream_Convert_Function; end Check_OK_Stream_Convert_Function;
...@@ -16831,8 +16824,8 @@ package body Sem_Prag is ...@@ -16831,8 +16824,8 @@ package body Sem_Prag is
elsif not Is_Static_String_Expression (Arg1) then elsif not Is_Static_String_Expression (Arg1) then
Error_Pragma_Arg Error_Pragma_Arg
("argument of pragma% must be On/Off or " & ("argument of pragma% must be On/Off or "
"static string expression", Arg1); & "static string expression", Arg1);
-- One argument string expression case -- One argument string expression case
...@@ -16876,8 +16869,8 @@ package body Sem_Prag is ...@@ -16876,8 +16869,8 @@ package body Sem_Prag is
if not Set_Dot_Warning_Switch (Chr) then if not Set_Dot_Warning_Switch (Chr) then
Error_Pragma_Arg Error_Pragma_Arg
("invalid warning switch character " & ("invalid warning switch character "
'.' & Chr, Arg1); & '.' & Chr, Arg1);
end if; end if;
-- Non-Dot case -- Non-Dot case
...@@ -16970,8 +16963,8 @@ package body Sem_Prag is ...@@ -16970,8 +16963,8 @@ package body Sem_Prag is
elsif not Is_Static_String_Expression (Arg2) then elsif not Is_Static_String_Expression (Arg2) then
Error_Pragma_Arg Error_Pragma_Arg
("second argument of pragma% must be entity " & ("second argument of pragma% must be entity "
"name or static string expression", Arg2); & "name or static string expression", Arg2);
-- String literal case -- String literal case
...@@ -17010,8 +17003,8 @@ package body Sem_Prag is ...@@ -17010,8 +17003,8 @@ package body Sem_Prag is
if Err then if Err then
Error_Msg Error_Msg
("??pragma Warnings On with no " & ("??pragma Warnings On with no "
"matching Warnings Off", & "matching Warnings Off",
Loc); Loc);
end if; end if;
end if; end if;
......
...@@ -487,22 +487,40 @@ begin ...@@ -487,22 +487,40 @@ begin
pragma Import (C, save_argv); pragma Import (C, save_argv);
-- Saved value of argv (argument pointers), imported from misc.c -- Saved value of argv (argument pointers), imported from misc.c
function Len_Arg (Arg : Pos) return Nat;
-- Determine length of argument number Arg on original gnat1 command
-- line.
-------------
-- Len_Arg --
-------------
function Len_Arg (Arg : Pos) return Nat is
begin
for J in 1 .. Nat'Last loop
if save_argv (Arg).all (Natural (J)) = ASCII.NUL then
return J - 1;
end if;
end loop;
raise Program_Error;
end Len_Arg;
begin begin
-- Loop through arguments looking for -gnateT, also look for -gnatd.b -- Loop through arguments looking for -gnateT, also look for -gnatd.b
for Arg in 1 .. save_argc - 1 loop for Arg in 1 .. save_argc - 1 loop
declare declare
Argv_Ptr : constant Big_String_Ptr := save_argv (Arg); Argv_Ptr : constant Big_String_Ptr := save_argv (Arg);
Argv_Len : constant Nat := Len_Arg (Arg);
begin begin
if Argv_Len = 7
-- ??? Is there no problem accessing at indices 1 to 7 or 8 and then Argv_Ptr (1 .. 7) = "-gnateT"
-- without first checking if the length of the underlying string then
-- may be smaller? See back_end.adb for an example where function
-- Len_Arg is used to retrieve this length.
if Argv_Ptr (1 .. 7) = "-gnateT" then
Opt.Target_Dependent_Info_Read := True; Opt.Target_Dependent_Info_Read := True;
elsif Argv_Ptr (1 .. 8) = "-gnatd.b" then elsif Argv_Len >= 8
and then Argv_Ptr (1 .. 8) = "-gnatd.b"
then
Debug_Flag_Dot_B := True; Debug_Flag_Dot_B := True;
end if; end if;
end; end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment