Mercurial > hg > CbC > CbC_gcc
comparison gcc/ada/doc/gnat_rm/implementation_defined_pragmas.rst @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
369 | 369 |
370 | 370 |
371 This configuration pragma is a synonym for pragma Ada_12 and has the | 371 This configuration pragma is a synonym for pragma Ada_12 and has the |
372 same syntax and effect. | 372 same syntax and effect. |
373 | 373 |
374 Pragma Aggregate_Individually_Assign | |
375 ==================================== | |
376 | |
377 Syntax: | |
378 | |
379 .. code-block:: ada | |
380 | |
381 pragma Aggregate_Individually_Assign; | |
382 | |
383 Where possible, GNAT will store the binary representation of a record aggregate | |
384 in memory for space and performance reasons. This configuration pragma changes | |
385 this behavior so that record aggregates are instead always converted into | |
386 individual assignment statements. | |
387 | |
388 | |
374 Pragma Allow_Integer_Address | 389 Pragma Allow_Integer_Address |
375 ============================ | 390 ============================ |
376 | 391 |
377 Syntax: | 392 Syntax: |
378 | 393 |
438 the type of annotation. GNAT verifies that it is an identifier, but does | 453 the type of annotation. GNAT verifies that it is an identifier, but does |
439 not otherwise analyze it. The second optional identifier is also left | 454 not otherwise analyze it. The second optional identifier is also left |
440 unanalyzed, and by convention is used to control the action of the tool to | 455 unanalyzed, and by convention is used to control the action of the tool to |
441 which the annotation is addressed. The remaining ARG arguments | 456 which the annotation is addressed. The remaining ARG arguments |
442 can be either string literals or more generally expressions. | 457 can be either string literals or more generally expressions. |
443 String literals are assumed to be either of type | 458 String literals (and concatenations of string literals) are assumed to be |
459 either of type | |
444 ``Standard.String`` or else ``Wide_String`` or ``Wide_Wide_String`` | 460 ``Standard.String`` or else ``Wide_String`` or ``Wide_Wide_String`` |
445 depending on the character literals they contain. | 461 depending on the character literals they contain. |
446 All other kinds of arguments are analyzed as expressions, and must be | 462 All other kinds of arguments are analyzed as expressions, and must be |
447 unambiguous. The last argument if present must have the identifier | 463 unambiguous. The last argument if present must have the identifier |
448 ``Entity`` and GNAT verifies that a local name is given. | 464 ``Entity`` and GNAT verifies that a local name is given. |
717 | 733 |
718 Syntax: | 734 Syntax: |
719 | 735 |
720 .. code-block:: ada | 736 .. code-block:: ada |
721 | 737 |
722 pragma Asynch_Readers [ (boolean_EXPRESSION) ]; | 738 pragma Async_Readers [ (boolean_EXPRESSION) ]; |
723 | 739 |
724 For the semantics of this pragma, see the entry for aspect ``Async_Readers`` in | 740 For the semantics of this pragma, see the entry for aspect ``Async_Readers`` in |
725 the SPARK 2014 Reference Manual, section 7.1.2. | 741 the SPARK 2014 Reference Manual, section 7.1.2. |
726 | 742 |
727 .. _Pragma-Async_Writers: | 743 .. _Pragma-Async_Writers: |
731 | 747 |
732 Syntax: | 748 Syntax: |
733 | 749 |
734 .. code-block:: ada | 750 .. code-block:: ada |
735 | 751 |
736 pragma Asynch_Writers [ (boolean_EXPRESSION) ]; | 752 pragma Async_Writers [ (boolean_EXPRESSION) ]; |
737 | 753 |
738 For the semantics of this pragma, see the entry for aspect ``Async_Writers`` in | 754 For the semantics of this pragma, see the entry for aspect ``Async_Writers`` in |
739 the SPARK 2014 Reference Manual, section 7.1.2. | 755 the SPARK 2014 Reference Manual, section 7.1.2. |
740 | 756 |
741 Pragma Attribute_Definition | 757 Pragma Attribute_Definition |
1326 | 1342 |
1327 | 1343 |
1328 The precondition ensures that one and only one of the case guards is | 1344 The precondition ensures that one and only one of the case guards is |
1329 satisfied on entry to the subprogram. | 1345 satisfied on entry to the subprogram. |
1330 The postcondition ensures that for the case guard that was True on entry, | 1346 The postcondition ensures that for the case guard that was True on entry, |
1331 the corrresponding consequence is True on exit. Other consequence expressions | 1347 the corresponding consequence is True on exit. Other consequence expressions |
1332 are not evaluated. | 1348 are not evaluated. |
1333 | 1349 |
1334 A precondition ``P`` and postcondition ``Q`` can also be | 1350 A precondition ``P`` and postcondition ``Q`` can also be |
1335 expressed as contract cases: | 1351 expressed as contract cases: |
1336 | 1352 |
2430 will be forced to all uppercase letters. If ``Lowercase`` is specified, | 2446 will be forced to all uppercase letters. If ``Lowercase`` is specified, |
2431 then the name will be forced to all lowercase letters. A specification of | 2447 then the name will be forced to all lowercase letters. A specification of |
2432 ``As_Is`` provides the normal default behavior in which the casing is | 2448 ``As_Is`` provides the normal default behavior in which the casing is |
2433 taken from the string provided. | 2449 taken from the string provided. |
2434 | 2450 |
2435 This pragma may appear anywhere that a pragma is valid. In particular, it | 2451 This pragma may appear anywhere that a pragma is valid. In particular, it |
2436 can be used as a configuration pragma in the :file:`gnat.adc` file, in which | 2452 can be used as a configuration pragma in the :file:`gnat.adc` file, in which |
2437 case it applies to all subsequent compilations, or it can be used as a program | 2453 case it applies to all subsequent compilations, or it can be used as a program |
2438 unit pragma, in which case it only applies to the current unit, or it can | 2454 unit pragma, in which case it only applies to the current unit, or it can |
2439 be used more locally to control individual Import/Export pragmas. | 2455 be used more locally to control individual Import/Export pragmas. |
2440 | 2456 |
2997 Syntax: | 3013 Syntax: |
2998 | 3014 |
2999 | 3015 |
3000 .. code-block:: ada | 3016 .. code-block:: ada |
3001 | 3017 |
3002 pragma Initialize_Scalars; | 3018 pragma Initialize_Scalars |
3003 | 3019 [ ( TYPE_VALUE_PAIR {, TYPE_VALUE_PAIR} ) ]; |
3004 | 3020 |
3005 This pragma is similar to ``Normalize_Scalars`` conceptually but has | 3021 TYPE_VALUE_PAIR ::= |
3006 two important differences. First, there is no requirement for the pragma | 3022 SCALAR_TYPE => static_EXPRESSION |
3007 to be used uniformly in all units of a partition, in particular, it is fine | 3023 |
3008 to use this just for some or all of the application units of a partition, | 3024 SCALAR_TYPE := |
3009 without needing to recompile the run-time library. | 3025 Short_Float |
3010 | 3026 | Float |
3011 In the case where some units are compiled with the pragma, and some without, | 3027 | Long_Float |
3012 then a declaration of a variable where the type is defined in package | 3028 | Long_Long_Flat |
3013 Standard or is locally declared will always be subject to initialization, | 3029 | Signed_8 |
3014 as will any declaration of a scalar variable. For composite variables, | 3030 | Signed_16 |
3015 whether the variable is initialized may also depend on whether the package | 3031 | Signed_32 |
3016 in which the type of the variable is declared is compiled with the pragma. | 3032 | Signed_64 |
3017 | 3033 | Unsigned_8 |
3018 The other important difference is that you can control the value used | 3034 | Unsigned_16 |
3019 for initializing scalar objects. At bind time, you can select several | 3035 | Unsigned_32 |
3020 options for initialization. You can | 3036 | Unsigned_64 |
3021 initialize with invalid values (similar to Normalize_Scalars, though for | 3037 |
3022 Initialize_Scalars it is not always possible to determine the invalid | 3038 |
3023 values in complex cases like signed component fields with non-standard | 3039 This pragma is similar to ``Normalize_Scalars`` conceptually but has two |
3024 sizes). You can also initialize with high or | 3040 important differences. |
3025 low values, or with a specified bit pattern. See the GNAT | 3041 |
3026 User's Guide for binder options for specifying these cases. | 3042 First, there is no requirement for the pragma to be used uniformly in all units |
3027 | 3043 of a partition. In particular, it is fine to use this just for some or all of |
3028 This means that you can compile a program, and then without having to | 3044 the application units of a partition, without needing to recompile the run-time |
3029 recompile the program, you can run it with different values being used | 3045 library. In the case where some units are compiled with the pragma, and some |
3030 for initializing otherwise uninitialized values, to test if your program | 3046 without, then a declaration of a variable where the type is defined in package |
3031 behavior depends on the choice. Of course the behavior should not change, | 3047 Standard or is locally declared will always be subject to initialization, as |
3032 and if it does, then most likely you have an incorrect reference to an | 3048 will any declaration of a scalar variable. For composite variables, whether the |
3033 uninitialized value. | 3049 variable is initialized may also depend on whether the package in which the |
3034 | 3050 type of the variable is declared is compiled with the pragma. |
3035 It is even possible to change the value at execution time eliminating even | 3051 |
3036 the need to rebind with a different switch using an environment variable. | 3052 The other important difference is that the programmer can control the value |
3037 See the GNAT User's Guide for details. | 3053 used for initializing scalar objects. This effect can be achieved in several |
3038 | 3054 different ways: |
3039 Note that pragma ``Initialize_Scalars`` is particularly useful in | 3055 |
3040 conjunction with the enhanced validity checking that is now provided | 3056 * At compile time, the programmer can specify the invalid value for a |
3041 in GNAT, which checks for invalid values under more conditions. | 3057 particular family of scalar types using the optional arguments of the pragma. |
3042 Using this feature (see description of the *-gnatV* flag in the | 3058 |
3043 GNAT User's Guide) in conjunction with | 3059 The compile-time approach is intended to optimize the generated code for the |
3044 pragma ``Initialize_Scalars`` | 3060 pragma, by possibly using fast operations such as ``memset``. Note that such |
3045 provides a powerful new tool to assist in the detection of problems | 3061 optimizations require using values where the bytes all have the same binary |
3046 caused by uninitialized variables. | 3062 representation. |
3047 | 3063 |
3048 Note: the use of ``Initialize_Scalars`` has a fairly extensive | 3064 * At bind time, the programmer has several options: |
3049 effect on the generated code. This may cause your code to be | 3065 |
3050 substantially larger. It may also cause an increase in the amount | 3066 * Initialization with invalid values (similar to Normalize_Scalars, though |
3051 of stack required, so it is probably a good idea to turn on stack | 3067 for Initialize_Scalars it is not always possible to determine the invalid |
3052 checking (see description of stack checking in the GNAT | 3068 values in complex cases like signed component fields with nonstandard |
3053 User's Guide) when using this pragma. | 3069 sizes). |
3070 | |
3071 * Initialization with high values. | |
3072 | |
3073 * Initialization with low values. | |
3074 | |
3075 * Initialization with a specific bit pattern. | |
3076 | |
3077 See the GNAT User's Guide for binder options for specifying these cases. | |
3078 | |
3079 The bind-time approach is intended to provide fast turnaround for testing | |
3080 with different values, without having to recompile the program. | |
3081 | |
3082 * At execution time, the programmer can specify the invalid values using an | |
3083 environment variable. See the GNAT User's Guide for details. | |
3084 | |
3085 The execution-time approach is intended to provide fast turnaround for | |
3086 testing with different values, without having to recompile and rebind the | |
3087 program. | |
3088 | |
3089 Note that pragma ``Initialize_Scalars`` is particularly useful in conjunction | |
3090 with the enhanced validity checking that is now provided in GNAT, which checks | |
3091 for invalid values under more conditions. Using this feature (see description | |
3092 of the *-gnatV* flag in the GNAT User's Guide) in conjunction with pragma | |
3093 ``Initialize_Scalars`` provides a powerful new tool to assist in the detection | |
3094 of problems caused by uninitialized variables. | |
3095 | |
3096 Note: the use of ``Initialize_Scalars`` has a fairly extensive effect on the | |
3097 generated code. This may cause your code to be substantially larger. It may | |
3098 also cause an increase in the amount of stack required, so it is probably a | |
3099 good idea to turn on stack checking (see description of stack checking in the | |
3100 GNAT User's Guide) when using this pragma. | |
3054 | 3101 |
3055 .. _Pragma-Initializes: | 3102 .. _Pragma-Initializes: |
3056 | 3103 |
3057 Pragma Initializes | 3104 Pragma Initializes |
3058 ================== | 3105 ================== |
3208 ``abort`` statement and stack overflow checking. | 3255 ``abort`` statement and stack overflow checking. |
3209 | 3256 |
3210 Pragma ``Interrupt_State`` provides a general mechanism for overriding | 3257 Pragma ``Interrupt_State`` provides a general mechanism for overriding |
3211 such uses of interrupts. It subsumes the functionality of pragma | 3258 such uses of interrupts. It subsumes the functionality of pragma |
3212 ``Unreserve_All_Interrupts``. Pragma ``Interrupt_State`` is not | 3259 ``Unreserve_All_Interrupts``. Pragma ``Interrupt_State`` is not |
3213 available on Windows or VMS. On all other platforms than VxWorks, | 3260 available on Windows. On all other platforms than VxWorks, |
3214 it applies to signals; on VxWorks, it applies to vectored hardware interrupts | 3261 it applies to signals; on VxWorks, it applies to vectored hardware interrupts |
3215 and may be used to mark interrupts required by the board support package | 3262 and may be used to mark interrupts required by the board support package |
3216 as reserved. | 3263 as reserved. |
3217 | 3264 |
3218 Interrupts can be in one of three states: | 3265 Interrupts can be in one of three states: |
3618 This pragma may be specified for protected types or objects. It specifies that | 3665 This pragma may be specified for protected types or objects. It specifies that |
3619 the implementation of protected operations must be implemented without locks. | 3666 the implementation of protected operations must be implemented without locks. |
3620 Compilation fails if the compiler cannot generate lock-free code for the | 3667 Compilation fails if the compiler cannot generate lock-free code for the |
3621 operations. | 3668 operations. |
3622 | 3669 |
3670 The current conditions required to support this pragma are: | |
3671 | |
3672 * Protected type declarations may not contain entries | |
3673 * Protected subprogram declarations may not have nonelementary parameters | |
3674 | |
3675 In addition, each protected subprogram body must satisfy: | |
3676 | |
3677 * May reference only one protected component | |
3678 * May not reference nonconstant entities outside the protected subprogram | |
3679 scope. | |
3680 * May not contain address representation items, allocators, or quantified | |
3681 expressions. | |
3682 * May not contain delay, goto, loop, or procedure-call statements. | |
3683 * May not contain exported and imported entities | |
3684 * May not dereferenced access values | |
3685 * Function calls and attribute references must be static | |
3686 | |
3687 | |
3623 Pragma Loop_Invariant | 3688 Pragma Loop_Invariant |
3624 ===================== | 3689 ===================== |
3625 | 3690 |
3626 Syntax: | 3691 Syntax: |
3627 | 3692 |
3764 :: | 3829 :: |
3765 | 3830 |
3766 pragma Machine_Attribute ( | 3831 pragma Machine_Attribute ( |
3767 [Entity =>] LOCAL_NAME, | 3832 [Entity =>] LOCAL_NAME, |
3768 [Attribute_Name =>] static_string_EXPRESSION | 3833 [Attribute_Name =>] static_string_EXPRESSION |
3769 [, [Info =>] static_EXPRESSION] ); | 3834 [, [Info =>] static_EXPRESSION {, static_EXPRESSION}] ); |
3770 | 3835 |
3771 | 3836 |
3772 Machine-dependent attributes can be specified for types and/or | 3837 Machine-dependent attributes can be specified for types and/or |
3773 declarations. This pragma is semantically equivalent to | 3838 declarations. This pragma is semantically equivalent to |
3774 :samp:`__attribute__(({attribute_name}))` (if ``info`` is not | 3839 :samp:`__attribute__(({attribute_name}))` (if ``info`` is not |
3775 specified) or :samp:`__attribute__(({attribute_name(info})))` | 3840 specified) or :samp:`__attribute__(({attribute_name(info})))` |
3776 in GNU C, where *attribute_name* is recognized by the | 3841 or :samp:`__attribute__(({attribute_name(info,...})))` in GNU C, |
3777 compiler middle-end or the ``TARGET_ATTRIBUTE_TABLE`` machine | 3842 where *attribute_name* is recognized by the compiler middle-end |
3778 specific macro. A string literal for the optional parameter ``info`` | 3843 or the ``TARGET_ATTRIBUTE_TABLE`` machine specific macro. Note |
3779 is transformed into an identifier, which may make this pragma unusable | 3844 that a string literal for the optional parameter ``info`` or the |
3780 for some attributes. | 3845 following ones is transformed by default into an identifier, |
3846 which may make this pragma unusable for some attributes. | |
3781 For further information see :title:`GNU Compiler Collection (GCC) Internals`. | 3847 For further information see :title:`GNU Compiler Collection (GCC) Internals`. |
3782 | 3848 |
3783 Pragma Main | 3849 Pragma Main |
3784 =========== | 3850 =========== |
3785 | 3851 |
3823 pragma Max_Entry_Queue (static_integer_EXPRESSION); | 3889 pragma Max_Entry_Queue (static_integer_EXPRESSION); |
3824 | 3890 |
3825 | 3891 |
3826 This pragma is used to specify the maximum callers per entry queue for | 3892 This pragma is used to specify the maximum callers per entry queue for |
3827 individual protected entries and entry families. It accepts a single | 3893 individual protected entries and entry families. It accepts a single |
3828 positive integer as a parameter and must appear after the declaration | 3894 integer (-1 or more) as a parameter and must appear after the declaration of an |
3829 of an entry. | 3895 entry. |
3896 | |
3897 A value of -1 represents no additional restriction on queue length. | |
3830 | 3898 |
3831 Pragma No_Body | 3899 Pragma No_Body |
3832 ============== | 3900 ============== |
3833 | 3901 |
3834 Syntax: | 3902 Syntax: |
3848 | 3916 |
3849 This is particularly useful during maintenance when a package is modified in | 3917 This is particularly useful during maintenance when a package is modified in |
3850 such a way that a body needed before is no longer needed. The provision of a | 3918 such a way that a body needed before is no longer needed. The provision of a |
3851 dummy body with a No_Body pragma ensures that there is no interference from | 3919 dummy body with a No_Body pragma ensures that there is no interference from |
3852 earlier versions of the package body. | 3920 earlier versions of the package body. |
3921 | |
3922 .. _Pragma-No_Caching: | |
3923 | |
3924 Pragma No_Caching | |
3925 ================= | |
3926 | |
3927 Syntax: | |
3928 | |
3929 .. code-block:: ada | |
3930 | |
3931 pragma No_Caching [ (boolean_EXPRESSION) ]; | |
3932 | |
3933 For the semantics of this pragma, see the entry for aspect ``No_Caching`` in | |
3934 the SPARK 2014 Reference Manual, section 7.1.2. | |
3853 | 3935 |
3854 Pragma No_Component_Reordering | 3936 Pragma No_Component_Reordering |
3855 ============================== | 3937 ============================== |
3856 | 3938 |
3857 Syntax: | 3939 Syntax: |
3967 statement sequence is a call to such a procedure. | 4049 statement sequence is a call to such a procedure. |
3968 | 4050 |
3969 Note that in Ada 2005 mode, this pragma is part of the language. It is | 4051 Note that in Ada 2005 mode, this pragma is part of the language. It is |
3970 available in all earlier versions of Ada as an implementation-defined | 4052 available in all earlier versions of Ada as an implementation-defined |
3971 pragma. | 4053 pragma. |
3972 | |
3973 Pragma No_Run_Time | |
3974 ================== | |
3975 | |
3976 Syntax: | |
3977 | |
3978 | |
3979 .. code-block:: ada | |
3980 | |
3981 pragma No_Run_Time; | |
3982 | |
3983 | |
3984 This is an obsolete configuration pragma that historically was used to | |
3985 set up a runtime library with no object code. It is now used only for | |
3986 internal testing. The pragma has been superseded by the reconfigurable | |
3987 runtime capability of GNAT. | |
3988 | 4054 |
3989 Pragma No_Strict_Aliasing | 4055 Pragma No_Strict_Aliasing |
3990 ========================= | 4056 ========================= |
3991 | 4057 |
3992 Syntax: | 4058 Syntax: |
6114 file naming is controlled by Source_File_Name_Project pragmas, which are | 6180 file naming is controlled by Source_File_Name_Project pragmas, which are |
6115 usually supplied automatically by the project manager. A pragma | 6181 usually supplied automatically by the project manager. A pragma |
6116 Source_File_Name cannot appear after a :ref:`Pragma_Source_File_Name_Project`. | 6182 Source_File_Name cannot appear after a :ref:`Pragma_Source_File_Name_Project`. |
6117 | 6183 |
6118 For more details on the use of the ``Source_File_Name`` pragma, see the | 6184 For more details on the use of the ``Source_File_Name`` pragma, see the |
6119 sections on ``Using Other File Names`` and `Alternative File Naming Schemes' | 6185 sections on `Using Other File Names` and `Alternative File Naming Schemes` |
6120 in the :title:`GNAT User's Guide`. | 6186 in the :title:`GNAT User's Guide`. |
6121 | 6187 |
6122 .. _Pragma_Source_File_Name_Project: | 6188 .. _Pragma_Source_File_Name_Project: |
6123 | 6189 |
6124 Pragma Source_File_Name_Project | 6190 Pragma Source_File_Name_Project |
7309 | 7375 |
7310 $ gcc -c -gnatVim ... | 7376 $ gcc -c -gnatVim ... |
7311 | 7377 |
7312 | 7378 |
7313 The form ALL_CHECKS activates all standard checks (its use is equivalent | 7379 The form ALL_CHECKS activates all standard checks (its use is equivalent |
7314 to the use of the :switch:`gnatva` switch. | 7380 to the use of the :switch:`gnatVa` switch). |
7315 | 7381 |
7316 The forms with ``Off`` and ``On`` | 7382 The forms with ``Off`` and ``On`` can be used to temporarily disable |
7317 can be used to temporarily disable validity checks | 7383 validity checks as shown in the following example: |
7318 as shown in the following example: | |
7319 | 7384 |
7320 | 7385 |
7321 .. code-block:: ada | 7386 .. code-block:: ada |
7322 | 7387 |
7323 pragma Validity_Checks ("c"); -- validity checks for copies | 7388 pragma Validity_Checks ("c"); -- validity checks for copies |
7324 pragma Validity_Checks (Off); -- turn off validity checks | 7389 pragma Validity_Checks (Off); -- turn off validity checks |
7325 A := B; -- B will not be validity checked | 7390 A := B; -- B will not be validity checked |
7326 pragma Validity_Checks (On); -- turn validity checks back on | 7391 pragma Validity_Checks (On); -- turn validity checks back on |
7327 A := C; -- C will be validity checked | 7392 A := C; -- C will be validity checked |
7328 | 7393 |
7394 .. _Pragma-Volatile: | |
7329 | 7395 |
7330 Pragma Volatile | 7396 Pragma Volatile |
7331 =============== | 7397 =============== |
7332 | 7398 |
7333 Syntax: | 7399 Syntax: |
7359 | 7425 |
7360 | 7426 |
7361 This is similar in effect to pragma Volatile, except that any reference to the | 7427 This is similar in effect to pragma Volatile, except that any reference to the |
7362 object is guaranteed to be done only with instructions that read or write all | 7428 object is guaranteed to be done only with instructions that read or write all |
7363 the bits of the object. Furthermore, if the object is of a composite type, | 7429 the bits of the object. Furthermore, if the object is of a composite type, |
7364 then any reference to a component of the object is guaranteed to read and/or | 7430 then any reference to a subcomponent of the object is guaranteed to read |
7365 write all the bits of the object. | 7431 and/or write all the bits of the object. |
7366 | 7432 |
7367 The intention is that this be suitable for use with memory-mapped I/O devices | 7433 The intention is that this be suitable for use with memory-mapped I/O devices |
7368 on some machines. Note that there are two important respects in which this is | 7434 on some machines. Note that there are two important respects in which this is |
7369 different from ``pragma Atomic``. First a reference to a ``Volatile_Full_Access`` | 7435 different from ``pragma Atomic``. First a reference to a ``Volatile_Full_Access`` |
7370 object is not a sequential action in the RM 9.10 sense and, therefore, does | 7436 object is not a sequential action in the RM 9.10 sense and, therefore, does |
7372 there is no guarantee that all the bits will be accessed if the reference | 7438 there is no guarantee that all the bits will be accessed if the reference |
7373 is not to the whole object; the compiler is allowed (and generally will) | 7439 is not to the whole object; the compiler is allowed (and generally will) |
7374 access only part of the object in this case. | 7440 access only part of the object in this case. |
7375 | 7441 |
7376 It is not permissible to specify ``Atomic`` and ``Volatile_Full_Access`` for | 7442 It is not permissible to specify ``Atomic`` and ``Volatile_Full_Access`` for |
7377 the same object. | 7443 the same type or object. |
7378 | 7444 |
7379 It is not permissible to specify ``Volatile_Full_Access`` for a composite | 7445 It is not permissible to specify ``Volatile_Full_Access`` for a composite |
7380 (record or array) type or object that has at least one ``Aliased`` component. | 7446 (record or array) type or object that has an ``Aliased`` subcomponent. |
7381 | 7447 |
7382 .. _Pragma-Volatile_Function: | 7448 .. _Pragma-Volatile_Function: |
7383 | 7449 |
7384 Pragma Volatile_Function | 7450 Pragma Volatile_Function |
7385 ======================== | 7451 ======================== |
7403 | 7469 |
7404 pragma Warning_As_Error (static_string_EXPRESSION); | 7470 pragma Warning_As_Error (static_string_EXPRESSION); |
7405 | 7471 |
7406 | 7472 |
7407 This configuration pragma allows the programmer to specify a set | 7473 This configuration pragma allows the programmer to specify a set |
7408 of warnings that will be treated as errors. Any warning which | 7474 of warnings that will be treated as errors. Any warning that |
7409 matches the pattern given by the pragma argument will be treated | 7475 matches the pattern given by the pragma argument will be treated |
7410 as an error. This gives much more precise control that -gnatwe | 7476 as an error. This gives more precise control than -gnatwe, |
7411 which treats all warnings as errors. | 7477 which treats warnings as errors. |
7412 | 7478 |
7413 The pattern may contain asterisks, which match zero or more characters in | 7479 This pragma can apply to regular warnings (messages enabled by -gnatw) |
7414 the message. For example, you can use | 7480 and to style warnings (messages that start with "(style)", |
7415 ``pragma Warning_As_Error ("bits of*unused")`` to treat the warning | 7481 enabled by -gnaty). |
7416 message ``warning: 960 bits of "a" unused`` as an error. No other regular | 7482 |
7417 expression notations are permitted. All characters other than asterisk in | 7483 The pattern may contain asterisks, which match zero or more characters |
7418 these three specific cases are treated as literal characters in the match. | 7484 in the message. For example, you can use ``pragma Warning_As_Error |
7419 The match is case insensitive, for example XYZ matches xyz. | 7485 ("bits of*unused")`` to treat the warning message ``warning: 960 bits of |
7486 "a" unused`` as an error. All characters other than asterisk are treated | |
7487 as literal characters in the match. The match is case insensitive; for | |
7488 example XYZ matches xyz. | |
7420 | 7489 |
7421 Note that the pattern matches if it occurs anywhere within the warning | 7490 Note that the pattern matches if it occurs anywhere within the warning |
7422 message string (it is not necessary to put an asterisk at the start and | 7491 message string (it is not necessary to put an asterisk at the start and |
7423 the end of the message, since this is implied). | 7492 the end of the message, since this is implied). |
7424 | 7493 |
7425 Another possibility for the static_string_EXPRESSION which works whether | 7494 Another possibility for the static_string_EXPRESSION which works whether |
7426 or not error tags are enabled (*-gnatw.d*) is to use the | 7495 or not error tags are enabled (*-gnatw.d*) is to use a single |
7427 *-gnatw* tag string, enclosed in brackets, | 7496 *-gnatw* tag string, enclosed in brackets, |
7428 as shown in the example below, to treat a class of warnings as errors. | 7497 as shown in the example below, to treat one category of warnings as errors. |
7498 Note that if you want to treat multiple categories of warnings as errors, | |
7499 you can use multiple pragma Warning_As_Error. | |
7429 | 7500 |
7430 The above use of patterns to match the message applies only to warning | 7501 The above use of patterns to match the message applies only to warning |
7431 messages generated by the front end. This pragma can also be applied to | 7502 messages generated by the front end. This pragma can also be applied to |
7432 warnings provided by the back end and mentioned in :ref:`Pragma_Warnings`. | 7503 warnings provided by the back end and mentioned in :ref:`Pragma_Warnings`. |
7433 By using a single full *-Wxxx* switch in the pragma, such warnings | 7504 By using a single full *-Wxxx* switch in the pragma, such warnings |
7621 asterisks since this looks like an operator name. This form with three | 7692 asterisks since this looks like an operator name. This form with three |
7622 asterisks is similar in effect to specifying ``pragma Warnings (Off)`` except (if :switch:`-gnatw.w` is given) that a matching | 7693 asterisks is similar in effect to specifying ``pragma Warnings (Off)`` except (if :switch:`-gnatw.w` is given) that a matching |
7623 ``pragma Warnings (On, "***")`` will be required. This can be | 7694 ``pragma Warnings (On, "***")`` will be required. This can be |
7624 helpful in avoiding forgetting to turn warnings back on. | 7695 helpful in avoiding forgetting to turn warnings back on. |
7625 | 7696 |
7626 Note: the debug flag :switch:`-gnatd.i` (``/NOWARNINGS_PRAGMAS`` in VMS) can be | 7697 Note: the debug flag :switch:`-gnatd.i` can be |
7627 used to cause the compiler to entirely ignore all WARNINGS pragmas. This can | 7698 used to cause the compiler to entirely ignore all WARNINGS pragmas. This can |
7628 be useful in checking whether obsolete pragmas in existing programs are hiding | 7699 be useful in checking whether obsolete pragmas in existing programs are hiding |
7629 real problems. | 7700 real problems. |
7630 | 7701 |
7631 Note: pragma Warnings does not affect the processing of style messages. See | 7702 Note: pragma Warnings does not affect the processing of style messages. See |