Mercurial > hg > CbC > CbC_gcc
comparison gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.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 |
---|---|
1239 :switch:`-fdump-scos` | 1239 :switch:`-fdump-scos` |
1240 Generates SCO (Source Coverage Obligation) information in the ALI file. | 1240 Generates SCO (Source Coverage Obligation) information in the ALI file. |
1241 This information is used by advanced coverage tools. See unit :file:`SCOs` | 1241 This information is used by advanced coverage tools. See unit :file:`SCOs` |
1242 in the compiler sources for details in files :file:`scos.ads` and | 1242 in the compiler sources for details in files :file:`scos.ads` and |
1243 :file:`scos.adb`. | 1243 :file:`scos.adb`. |
1244 | |
1245 | |
1246 .. index:: -fgnat-encodings (gcc) | |
1247 | |
1248 :switch:`-fgnat-encodings=[all|gdb|minimal]` | |
1249 This switch controls the balance between GNAT encodings and standard DWARF | |
1250 emitted in the debug information. | |
1244 | 1251 |
1245 | 1252 |
1246 .. index:: -flto (gcc) | 1253 .. index:: -flto (gcc) |
1247 | 1254 |
1248 :switch:`-flto[={n}]` | 1255 :switch:`-flto[={n}]` |
1705 | 1712 |
1706 ``Bits_Per_Word`` is the number of bits in a machine word, the equivalent of | 1713 ``Bits_Per_Word`` is the number of bits in a machine word, the equivalent of |
1707 GCC macro ``BITS_PER_WORD`` documented as follows: `Number of bits in a word; | 1714 GCC macro ``BITS_PER_WORD`` documented as follows: `Number of bits in a word; |
1708 normally 32.` | 1715 normally 32.` |
1709 | 1716 |
1710 ``Double_Scalar_Alignment`` is the alignment for a scalar whose size is two | 1717 ``Double_Float_Alignment``, if not zero, is the maximum alignment that the |
1711 machine words. It should be the same as the alignment for C ``long_long`` on | 1718 compiler can choose by default for a 64-bit floating-point type or object. |
1712 most targets. | 1719 |
1713 | 1720 ``Double_Scalar_Alignment``, if not zero, is the maximum alignment that the |
1714 ``Maximum_Alignment`` is the maximum alignment that the compiler might choose | 1721 compiler can choose by default for a 64-bit or larger scalar type or object. |
1722 | |
1723 ``Maximum_Alignment`` is the maximum alignment that the compiler can choose | |
1715 by default for a type or object, which is also the maximum alignment that can | 1724 by default for a type or object, which is also the maximum alignment that can |
1716 be specified in GNAT. It is computed for GCC backends as ``BIGGEST_ALIGNMENT | 1725 be specified in GNAT. It is computed for GCC backends as ``BIGGEST_ALIGNMENT |
1717 / BITS_PER_UNIT`` where GCC macro ``BIGGEST_ALIGNMENT`` is documented as | 1726 / BITS_PER_UNIT`` where GCC macro ``BIGGEST_ALIGNMENT`` is documented as |
1718 follows: `Biggest alignment that any data type can require on this machine, | 1727 follows: `Biggest alignment that any data type can require on this machine, |
1719 in bits.` | 1728 in bits.` |
1827 | 1836 |
1828 | 1837 |
1829 .. index:: -gnatE (gcc) | 1838 .. index:: -gnatE (gcc) |
1830 | 1839 |
1831 :switch:`-gnatE` | 1840 :switch:`-gnatE` |
1832 Full dynamic elaboration checks. | 1841 Dynamic elaboration checking mode enabled. For further details see |
1842 :ref:`Elaboration_Order_Handling_in_GNAT`. | |
1833 | 1843 |
1834 | 1844 |
1835 .. index:: -gnatf (gcc) | 1845 .. index:: -gnatf (gcc) |
1836 | 1846 |
1837 :switch:`-gnatf` | 1847 :switch:`-gnatf` |
1869 | 1879 |
1870 | 1880 |
1871 .. index:: -gnatH (gcc) | 1881 .. index:: -gnatH (gcc) |
1872 | 1882 |
1873 :switch:`-gnatH` | 1883 :switch:`-gnatH` |
1874 Legacy elaboration-checking mode enabled. When this switch is in effect, the | 1884 Legacy elaboration-checking mode enabled. When this switch is in effect, |
1875 pre-18.x access-before-elaboration model becomes the de facto model. | 1885 the pre-18.x access-before-elaboration model becomes the de facto model. |
1886 For further details see :ref:`Elaboration_Order_Handling_in_GNAT`. | |
1876 | 1887 |
1877 | 1888 |
1878 .. index:: -gnati (gcc) | 1889 .. index:: -gnati (gcc) |
1879 | 1890 |
1880 :switch:`-gnati{c}` | 1891 :switch:`-gnati{c}` |
1926 - Indirect calls using 'Access | 1937 - Indirect calls using 'Access |
1927 - Requeue statements | 1938 - Requeue statements |
1928 - Select statements | 1939 - Select statements |
1929 - Synchronous task suspension | 1940 - Synchronous task suspension |
1930 | 1941 |
1931 and does not emit compile-time diagnostics or run-time checks. | 1942 and does not emit compile-time diagnostics or run-time checks. For further |
1943 details see :ref:`Elaboration_Order_Handling_in_GNAT`. | |
1932 | 1944 |
1933 | 1945 |
1934 .. index:: -gnatk (gcc) | 1946 .. index:: -gnatk (gcc) |
1935 | 1947 |
1936 :switch:`-gnatk={n}` | 1948 :switch:`-gnatk={n}` |
2079 Treat pragma Restrictions as Restriction_Warnings. | 2091 Treat pragma Restrictions as Restriction_Warnings. |
2080 | 2092 |
2081 | 2093 |
2082 .. index:: -gnatR (gcc) | 2094 .. index:: -gnatR (gcc) |
2083 | 2095 |
2084 :switch:`-gnatR[0|1|2|3][e][j][m][s]` | 2096 :switch:`-gnatR[0|1|2|3|4][e][j][m][s]` |
2085 Output representation information for declared types, objects and | 2097 Output representation information for declared types, objects and |
2086 subprograms. Note that this switch is not allowed if a previous | 2098 subprograms. Note that this switch is not allowed if a previous |
2087 :switch:`-gnatD` switch has been given, since these two switches | 2099 :switch:`-gnatD` switch has been given, since these two switches |
2088 are not compatible. | 2100 are not compatible. |
2089 | 2101 |
2363 e.adb:3:04: Incorrect spelling of keyword "function" | 2375 e.adb:3:04: Incorrect spelling of keyword "function" |
2364 e.adb:4:20: ";" should be "is" | 2376 e.adb:4:20: ";" should be "is" |
2365 | 2377 |
2366 The first integer after the file name is the line number in the file, | 2378 The first integer after the file name is the line number in the file, |
2367 and the second integer is the column number within the line. | 2379 and the second integer is the column number within the line. |
2368 ``GPS`` can parse the error messages | 2380 ``GNAT Studio`` can parse the error messages |
2369 and point to the referenced character. | 2381 and point to the referenced character. |
2370 The following switches provide control over the error message | 2382 The following switches provide control over the error message |
2371 format: | 2383 format: |
2372 | 2384 |
2373 | 2385 |
2746 .. index:: -gnatwa (gcc) | 2758 .. index:: -gnatwa (gcc) |
2747 | 2759 |
2748 :switch:`-gnatwa` | 2760 :switch:`-gnatwa` |
2749 *Activate most optional warnings.* | 2761 *Activate most optional warnings.* |
2750 | 2762 |
2751 This switch activates most optional warning messages. See the remaining list | 2763 This switch activates most optional warning messages. See the remaining list |
2752 in this section for details on optional warning messages that can be | 2764 in this section for details on optional warning messages that can be |
2753 individually controlled. The warnings that are not turned on by this | 2765 individually controlled. The warnings that are not turned on by this |
2754 switch are: | 2766 switch are: |
2755 | 2767 |
2756 | 2768 |
2775 * :switch:`-gnatwo` (address clause overlay) | 2787 * :switch:`-gnatwo` (address clause overlay) |
2776 | 2788 |
2777 * :switch:`-gnatw.o` (values set by out parameters ignored) | 2789 * :switch:`-gnatw.o` (values set by out parameters ignored) |
2778 | 2790 |
2779 * :switch:`-gnatw.q` (questionable layout of record types) | 2791 * :switch:`-gnatw.q` (questionable layout of record types) |
2792 | |
2793 * :switch:`-gnatw_r` (out-of-order record representation clauses) | |
2780 | 2794 |
2781 * :switch:`-gnatw.s` (overridden size clause) | 2795 * :switch:`-gnatw.s` (overridden size clause) |
2782 | 2796 |
2783 * :switch:`-gnatwt` (tracking of deleted conditional code) | 2797 * :switch:`-gnatwt` (tracking of deleted conditional code) |
2784 | 2798 |
2830 | 2844 |
2831 This switch suppresses warnings for assertions where the compiler can tell at | 2845 This switch suppresses warnings for assertions where the compiler can tell at |
2832 compile time that the assertion will fail. | 2846 compile time that the assertion will fail. |
2833 | 2847 |
2834 | 2848 |
2849 .. index:: -gnatw_a | |
2850 | |
2851 :switch:`-gnatw_a` | |
2852 *Activate warnings on anonymous allocators.* | |
2853 | |
2854 .. index:: Anonymous allocators | |
2855 | |
2856 This switch activates warnings for allocators of anonymous access types, | |
2857 which can involve run-time accessibility checks and lead to unexpected | |
2858 accessibility violations. For more details on the rules involved, see | |
2859 RM 3.10.2 (14). | |
2860 | |
2861 | |
2862 .. index:: -gnatw_A | |
2863 | |
2864 :switch:`-gnatw_A` | |
2865 *Supress warnings on anonymous allocators.* | |
2866 | |
2867 .. index:: Anonymous allocators | |
2868 | |
2869 This switch suppresses warnings for anonymous access type allocators. | |
2870 | |
2871 | |
2835 .. index:: -gnatwb (gcc) | 2872 .. index:: -gnatwb (gcc) |
2836 | 2873 |
2837 :switch:`-gnatwb` | 2874 :switch:`-gnatwb` |
2838 *Activate warnings on bad fixed values.* | 2875 *Activate warnings on bad fixed values.* |
2839 | 2876 |
2935 representation clause is present and has component clauses for the | 2972 representation clause is present and has component clauses for the |
2936 majority, but not all, of the components. A warning is given for each | 2973 majority, but not all, of the components. A warning is given for each |
2937 component for which no component clause is present. | 2974 component for which no component clause is present. |
2938 | 2975 |
2939 | 2976 |
2940 .. index:: -gnatwC (gcc) | 2977 .. index:: -gnatw.C (gcc) |
2941 | 2978 |
2942 :switch:`-gnatw.C` | 2979 :switch:`-gnatw.C` |
2943 *Suppress warnings on missing component clauses.* | 2980 *Suppress warnings on missing component clauses.* |
2944 | 2981 |
2945 This switch suppresses warnings for record components that are | 2982 This switch suppresses warnings for record components that are |
2946 missing a component clause in the situation described above. | 2983 missing a component clause in the situation described above. |
2984 | |
2985 | |
2986 .. index:: -gnatw_c (gcc) | |
2987 | |
2988 :switch:`-gnatw_c` | |
2989 *Activate warnings on unknown condition in Compile_Time_Warning.* | |
2990 | |
2991 .. index:: Compile_Time_Warning | |
2992 .. index:: Compile_Time_Error | |
2993 | |
2994 This switch activates warnings on a pragma Compile_Time_Warning | |
2995 or Compile_Time_Error whose condition has a value that is not | |
2996 known at compile time. | |
2997 The default is that such warnings are generated. | |
2998 | |
2999 | |
3000 .. index:: -gnatw_C (gcc) | |
3001 | |
3002 :switch:`-gnatw_C` | |
3003 *Suppress warnings on unknown condition in Compile_Time_Warning.* | |
3004 | |
3005 This switch supresses warnings on a pragma Compile_Time_Warning | |
3006 or Compile_Time_Error whose condition has a value that is not | |
3007 known at compile time. | |
2947 | 3008 |
2948 | 3009 |
2949 .. index:: -gnatwd (gcc) | 3010 .. index:: -gnatwd (gcc) |
2950 | 3011 |
2951 :switch:`-gnatwd` | 3012 :switch:`-gnatwd` |
3647 function call, which is equivalent to a constant declaration (as | 3708 function call, which is equivalent to a constant declaration (as |
3648 opposed to renaming the function itself). The default is that these | 3709 opposed to renaming the function itself). The default is that these |
3649 warnings are given. | 3710 warnings are given. |
3650 | 3711 |
3651 | 3712 |
3652 .. index:: -gnatwT (gcc) | 3713 .. index:: -gnatw.R (gcc) |
3653 | 3714 |
3654 :switch:`-gnatw.R` | 3715 :switch:`-gnatw.R` |
3655 *Suppress warnings for object renaming function.* | 3716 *Suppress warnings for object renaming function.* |
3656 | 3717 |
3657 This switch suppresses warnings for object renaming function. | 3718 This switch suppresses warnings for object renaming function. |
3719 | |
3720 | |
3721 .. index:: -gnatw_r (gcc) | |
3722 | |
3723 :switch:`-gnatw_r` | |
3724 *Activate warnings for out-of-order record representation clauses.* | |
3725 | |
3726 This switch activates warnings for record representation clauses, | |
3727 if the order of component declarations, component clauses, | |
3728 and bit-level layout do not all agree. | |
3729 The default is that these warnings are not given. | |
3730 | |
3731 | |
3732 .. index:: -gnatw_R (gcc) | |
3733 | |
3734 :switch:`-gnatw_R` | |
3735 *Suppress warnings for out-of-order record representation clauses.* | |
3658 | 3736 |
3659 | 3737 |
3660 .. index:: -gnatws (gcc) | 3738 .. index:: -gnatws (gcc) |
3661 | 3739 |
3662 :switch:`-gnatws` | 3740 :switch:`-gnatws` |
4036 .. index:: Size/Alignment warnings | 4114 .. index:: Size/Alignment warnings |
4037 | 4115 |
4038 :switch:`-gnatw.z` | 4116 :switch:`-gnatw.z` |
4039 *Activate warnings for size not a multiple of alignment.* | 4117 *Activate warnings for size not a multiple of alignment.* |
4040 | 4118 |
4041 This switch activates warnings for cases of record types with | 4119 This switch activates warnings for cases of array and record types |
4042 specified ``Size`` and ``Alignment`` attributes where the | 4120 with specified ``Size`` and ``Alignment`` attributes where the |
4043 size is not a multiple of the alignment, resulting in an object | 4121 size is not a multiple of the alignment, resulting in an object |
4044 size that is greater than the specified size. The default | 4122 size that is greater than the specified size. The default |
4045 is that such warnings are generated. | 4123 is that such warnings are generated. |
4046 | 4124 |
4047 | 4125 |
4049 .. index:: Size/Alignment warnings | 4127 .. index:: Size/Alignment warnings |
4050 | 4128 |
4051 :switch:`-gnatw.Z` | 4129 :switch:`-gnatw.Z` |
4052 *Suppress warnings for size not a multiple of alignment.* | 4130 *Suppress warnings for size not a multiple of alignment.* |
4053 | 4131 |
4054 This switch suppresses warnings for cases of record types with | 4132 This switch suppresses warnings for cases of array and record types |
4055 specified ``Size`` and ``Alignment`` attributes where the | 4133 with specified ``Size`` and ``Alignment`` attributes where the |
4056 size is not a multiple of the alignment, resulting in an object | 4134 size is not a multiple of the alignment, resulting in an object |
4057 size that is greater than the specified size. | 4135 size that is greater than the specified size. The warning can also |
4058 The warning can also be | 4136 be suppressed by giving an explicit ``Object_Size`` value. |
4059 suppressed by giving an explicit ``Object_Size`` value. | |
4060 | 4137 |
4061 | 4138 |
4062 .. index:: -Wunused (gcc) | 4139 .. index:: -Wunused (gcc) |
4063 | 4140 |
4064 :switch:`-Wunused` | 4141 :switch:`-Wunused` |
4682 All lines must be terminated by a single ASCII.LF | 4759 All lines must be terminated by a single ASCII.LF |
4683 character (in particular the DOS line terminator sequence CR/LF is not | 4760 character (in particular the DOS line terminator sequence CR/LF is not |
4684 allowed). | 4761 allowed). |
4685 | 4762 |
4686 | 4763 |
4764 .. index:: -gnatyD (gcc) | |
4765 | |
4766 :switch:`-gnatyD` | |
4767 *Check declared identifiers in mixed case.* | |
4768 | |
4769 Declared identifiers must be in mixed case, as in | |
4770 This_Is_An_Identifier. Use -gnatyr in addition to ensure | |
4771 that references match declarations. | |
4772 | |
4773 | |
4687 .. index:: -gnatye (gcc) | 4774 .. index:: -gnatye (gcc) |
4688 | 4775 |
4689 :switch:`-gnatye` | 4776 :switch:`-gnatye` |
4690 *Check end/exit labels.* | 4777 *Check end/exit labels.* |
4691 | 4778 |
4707 :switch:`-gnatyg` | 4794 :switch:`-gnatyg` |
4708 *GNAT style mode.* | 4795 *GNAT style mode.* |
4709 | 4796 |
4710 The set of style check switches is set to match that used by the GNAT sources. | 4797 The set of style check switches is set to match that used by the GNAT sources. |
4711 This may be useful when developing code that is eventually intended to be | 4798 This may be useful when developing code that is eventually intended to be |
4712 incorporated into GNAT. Currently this is equivalent to :switch:`-gnatwydISux`) | 4799 incorporated into GNAT. Currently this is equivalent to :switch:`-gnatyydISux`) |
4713 but additional style switches may be added to this set in the future without | 4800 but additional style switches may be added to this set in the future without |
4714 advance notice. | 4801 advance notice. |
4715 | 4802 |
4716 | 4803 |
4717 .. index:: -gnatyh (gcc) | 4804 .. index:: -gnatyh (gcc) |
5050 style check option. That is, it cancels the effect of a previous -, | 5137 style check option. That is, it cancels the effect of a previous -, |
5051 if any. | 5138 if any. |
5052 | 5139 |
5053 | 5140 |
5054 .. end of switch description (leave this comment to ease automatic parsing for | 5141 .. end of switch description (leave this comment to ease automatic parsing for |
5055 .. GPS | 5142 .. GNAT Studio |
5056 | 5143 |
5057 In the above rules, appearing in column one is always permitted, that is, | 5144 In the above rules, appearing in column one is always permitted, that is, |
5058 counts as meeting either a requirement for a required preceding space, | 5145 counts as meeting either a requirement for a required preceding space, |
5059 or as meeting a requirement for no preceding space. | 5146 or as meeting a requirement for no preceding space. |
5060 | 5147 |
5272 | 5359 |
5273 $ gcc -c -gnats x.adb | 5360 $ gcc -c -gnats x.adb |
5274 | 5361 |
5275 compiles file :file:`x.adb` in syntax-check-only mode. You can check a | 5362 compiles file :file:`x.adb` in syntax-check-only mode. You can check a |
5276 series of files in a single command | 5363 series of files in a single command |
5277 , and can use wild cards to specify such a group of files. | 5364 , and can use wildcards to specify such a group of files. |
5278 Note that you must specify the :switch:`-c` (compile | 5365 Note that you must specify the :switch:`-c` (compile |
5279 only) flag in addition to the :switch:`-gnats` flag. | 5366 only) flag in addition to the :switch:`-gnats` flag. |
5280 | 5367 |
5281 You may use other switches in conjunction with :switch:`-gnats`. In | 5368 You may use other switches in conjunction with :switch:`-gnats`. In |
5282 particular, :switch:`-gnatl` and :switch:`-gnatv` are useful to control the | 5369 particular, :switch:`-gnatl` and :switch:`-gnatv` are useful to control the |
5841 restriction warnings rather than restrictions. | 5928 restriction warnings rather than restrictions. |
5842 | 5929 |
5843 | 5930 |
5844 .. index:: -gnatR (gcc) | 5931 .. index:: -gnatR (gcc) |
5845 | 5932 |
5846 :switch:`-gnatR[0|1|2|3][e][j][m][s]` | 5933 :switch:`-gnatR[0|1|2|3|4][e][j][m][s]` |
5847 This switch controls output from the compiler of a listing showing | 5934 This switch controls output from the compiler of a listing showing |
5848 representation information for declared types, objects and subprograms. | 5935 representation information for declared types, objects and subprograms. |
5849 For :switch:`-gnatR0`, no information is output (equivalent to omitting | 5936 For :switch:`-gnatR0`, no information is output (equivalent to omitting |
5850 the :switch:`-gnatR` switch). For :switch:`-gnatR1` (which is the default, | 5937 the :switch:`-gnatR` switch). For :switch:`-gnatR1` (which is the default, |
5851 so :switch:`-gnatR` with no parameter has the same effect), size and | 5938 so :switch:`-gnatR` with no parameter has the same effect), size and |
5852 alignment information is listed for declared array and record types. | 5939 alignment information is listed for declared array and record types. |
5940 | |
5853 For :switch:`-gnatR2`, size and alignment information is listed for all | 5941 For :switch:`-gnatR2`, size and alignment information is listed for all |
5854 declared types and objects. The ``Linker_Section`` is also listed for any | 5942 declared types and objects. The ``Linker_Section`` is also listed for any |
5855 entity for which the ``Linker_Section`` is set explicitly or implicitly (the | 5943 entity for which the ``Linker_Section`` is set explicitly or implicitly (the |
5856 latter case occurs for objects of a type for which a ``Linker_Section`` | 5944 latter case occurs for objects of a type for which a ``Linker_Section`` |
5857 is set). | 5945 is set). |
5860 at run time for records are included. These symbolic expressions have | 5948 at run time for records are included. These symbolic expressions have |
5861 a mostly obvious format with #n being used to represent the value of the | 5949 a mostly obvious format with #n being used to represent the value of the |
5862 n'th discriminant. See source files :file:`repinfo.ads/adb` in the | 5950 n'th discriminant. See source files :file:`repinfo.ads/adb` in the |
5863 GNAT sources for full details on the format of :switch:`-gnatR3` output. | 5951 GNAT sources for full details on the format of :switch:`-gnatR3` output. |
5864 | 5952 |
5953 For :switch:`-gnatR4`, information for relevant compiler-generated types | |
5954 is also listed, i.e. when they are structurally part of other declared | |
5955 types and objects. | |
5956 | |
5865 If the switch is followed by an ``e`` (e.g. :switch:`-gnatR2e`), then | 5957 If the switch is followed by an ``e`` (e.g. :switch:`-gnatR2e`), then |
5866 extended representation information for record sub-components of records | 5958 extended representation information for record sub-components of records |
5867 are included. | 5959 is included. |
5868 | 5960 |
5869 If the switch is followed by an ``m`` (e.g. :switch:`-gnatRm`), then | 5961 If the switch is followed by an ``m`` (e.g. :switch:`-gnatRm`), then |
5870 subprogram conventions and parameter passing mechanisms for all the | 5962 subprogram conventions and parameter passing mechanisms for all the |
5871 subprograms are included. | 5963 subprograms are included. |
5872 | 5964 |
5875 ECMA-404 standard. The semantic description of this JSON output is | 5967 ECMA-404 standard. The semantic description of this JSON output is |
5876 available in the specification of the Repinfo unit present in the | 5968 available in the specification of the Repinfo unit present in the |
5877 compiler sources. | 5969 compiler sources. |
5878 | 5970 |
5879 If the switch is followed by an ``s`` (e.g., :switch:`-gnatR3s`), then | 5971 If the switch is followed by an ``s`` (e.g., :switch:`-gnatR3s`), then |
5880 the output is to a file with the name :file:`file.rep` where file is | 5972 the output is to a file with the name :file:`file.rep` where ``file`` is |
5881 the name of the corresponding source file, except if `j`` is also | 5973 the name of the corresponding source file, except if ``j`` is also |
5882 specified, in which case the file name is :file:`file.json`. | 5974 specified, in which case the file name is :file:`file.json`. |
5883 | 5975 |
5884 Note that it is possible for record components to have zero size. In | 5976 Note that it is possible for record components to have zero size. In |
5885 this case, the component clause uses an obvious extension of permitted | 5977 this case, the component clause uses an obvious extension of permitted |
5886 Ada syntax, for example ``at 0 range 0 .. -1``. | 5978 Ada syntax, for example ``at 0 range 0 .. -1``. |
5907 Normally the compiler generates full cross-referencing information in | 5999 Normally the compiler generates full cross-referencing information in |
5908 the :file:`ALI` file. This information is used by a number of tools, | 6000 the :file:`ALI` file. This information is used by a number of tools, |
5909 including ``gnatfind`` and ``gnatxref``. The :switch:`-gnatx` switch | 6001 including ``gnatfind`` and ``gnatxref``. The :switch:`-gnatx` switch |
5910 suppresses this information. This saves some space and may slightly | 6002 suppresses this information. This saves some space and may slightly |
5911 speed up compilation, but means that these tools cannot be used. | 6003 speed up compilation, but means that these tools cannot be used. |
6004 | |
6005 | |
6006 .. index:: -fgnat-encodings (gcc) | |
6007 | |
6008 :switch:`-fgnat-encodings=[all|gdb|minimal]` | |
6009 This switch controls the balance between GNAT encodings and standard DWARF | |
6010 emitted in the debug information. | |
6011 | |
6012 Historically, old debug formats like stabs were not powerful enough to | |
6013 express some Ada types (for instance, variant records or fixed-point types). | |
6014 To work around this, GNAT introduced proprietary encodings that embed the | |
6015 missing information ("GNAT encodings"). | |
6016 | |
6017 Recent versions of the DWARF debug information format are now able to | |
6018 correctly describe most of these Ada constructs ("standard DWARF"). As | |
6019 third-party tools started to use this format, GNAT has been enhanced to | |
6020 generate it. However, most tools (including GDB) are still relying on GNAT | |
6021 encodings. | |
6022 | |
6023 To support all tools, GNAT needs to be versatile about the balance between | |
6024 generation of GNAT encodings and standard DWARF. This is what | |
6025 :switch:`-fgnat-encodings` is about. | |
6026 | |
6027 * ``=all``: Emit all GNAT encodings, and then emit as much standard DWARF as | |
6028 possible so it does not conflict with GNAT encodings. | |
6029 * ``=gdb``: Emit as much standard DWARF as possible as long as the current | |
6030 GDB handles it. Emit GNAT encodings for the rest. | |
6031 * ``=minimal``: Emit as much standard DWARF as possible and emit GNAT | |
6032 encodings for the rest. | |
6033 | |
5912 | 6034 |
5913 .. _Exception_Handling_Control: | 6035 .. _Exception_Handling_Control: |
5914 | 6036 |
5915 Exception Handling Control | 6037 Exception Handling Control |
5916 -------------------------- | 6038 -------------------------- |
6315 | 6437 |
6316 | 6438 |
6317 .. index:: -f (gnatbind) | 6439 .. index:: -f (gnatbind) |
6318 | 6440 |
6319 :switch:`-f{elab-order}` | 6441 :switch:`-f{elab-order}` |
6320 Force elaboration order. | 6442 Force elaboration order. For further details see :ref:`Elaboration_Control` |
6443 and :ref:`Elaboration_Order_Handling_in_GNAT`. | |
6444 | |
6321 | 6445 |
6322 .. index:: -F (gnatbind) | 6446 .. index:: -F (gnatbind) |
6323 | 6447 |
6324 :switch:`-F` | 6448 :switch:`-F` |
6325 Force the checks of elaboration flags. ``gnatbind`` does not normally | 6449 Force the checks of elaboration flags. ``gnatbind`` does not normally |
6335 | 6459 |
6336 :switch:`-h` | 6460 :switch:`-h` |
6337 Output usage (help) information. | 6461 Output usage (help) information. |
6338 | 6462 |
6339 | 6463 |
6340 .. index:: -H32 (gnatbind) | 6464 .. index:: -H (gnatbind) |
6465 | |
6466 :switch:`-H` | |
6467 Legacy elaboration order model enabled. For further details see | |
6468 :ref:`Elaboration_Order_Handling_in_GNAT`. | |
6469 | |
6470 | |
6471 .. index:: -H32 (gnatbind) | |
6341 | 6472 |
6342 :switch:`-H32` | 6473 :switch:`-H32` |
6343 Use 32-bit allocations for ``__gnat_malloc`` (and thus for access types). | 6474 Use 32-bit allocations for ``__gnat_malloc`` (and thus for access types). |
6344 For further details see :ref:`Dynamic_Allocation_Control`. | 6475 For further details see :ref:`Dynamic_Allocation_Control`. |
6345 | 6476 |
6346 | 6477 |
6347 .. index:: -H64 (gnatbind) | 6478 .. index:: -H64 (gnatbind) |
6348 .. index:: __gnat_malloc | 6479 .. index:: __gnat_malloc |
6349 | 6480 |
6350 :switch:`-H64` | 6481 :switch:`-H64` |
6351 Use 64-bit allocations for ``__gnat_malloc`` (and thus for access types). | 6482 Use 64-bit allocations for ``__gnat_malloc`` (and thus for access types). |
6352 For further details see :ref:`Dynamic_Allocation_Control`. | 6483 For further details see :ref:`Dynamic_Allocation_Control`. |
6353 | 6484 |
6386 .. index:: -M (gnatbind) | 6517 .. index:: -M (gnatbind) |
6387 | 6518 |
6388 :switch:`-M{xyz}` | 6519 :switch:`-M{xyz}` |
6389 Rename generated main program from main to xyz. This option is | 6520 Rename generated main program from main to xyz. This option is |
6390 supported on cross environments only. | 6521 supported on cross environments only. |
6391 | |
6392 | 6522 |
6393 .. index:: -m (gnatbind) | 6523 .. index:: -m (gnatbind) |
6394 | 6524 |
6395 :switch:`-m{n}` | 6525 :switch:`-m{n}` |
6396 Limit number of detected errors or warnings to ``n``, where ``n`` is | 6526 Limit number of detected errors or warnings to ``n``, where ``n`` is |
6400 continues in this case. If the number of errors reaches this | 6530 continues in this case. If the number of errors reaches this |
6401 limit, then a message is output and the bind is abandoned. | 6531 limit, then a message is output and the bind is abandoned. |
6402 A value of zero means that no limit is enforced. The equal | 6532 A value of zero means that no limit is enforced. The equal |
6403 sign is optional. | 6533 sign is optional. |
6404 | 6534 |
6535 .. index:: -minimal (gnatbind) | |
6536 | |
6537 :switch:`-minimal` | |
6538 Generate a binder file suitable for space-constrained applications. When | |
6539 active, binder-generated objects not required for program operation are no | |
6540 longer generated. **Warning:** this option comes with the following | |
6541 limitations: | |
6542 | |
6543 * Starting the program's execution in the debugger will cause it to | |
6544 stop at the start of the ``main`` function instead of the main subprogram. | |
6545 This can be worked around by manually inserting a breakpoint on that | |
6546 subprogram and resuming the program's execution until reaching that breakpoint. | |
6547 * Programs using GNAT.Compiler_Version will not link. | |
6405 | 6548 |
6406 .. index:: -n (gnatbind) | 6549 .. index:: -n (gnatbind) |
6407 | 6550 |
6408 :switch:`-n` | 6551 :switch:`-n` |
6409 No main program. | 6552 No main program. |
6763 | 6906 |
6764 Elaboration Control | 6907 Elaboration Control |
6765 ^^^^^^^^^^^^^^^^^^^ | 6908 ^^^^^^^^^^^^^^^^^^^ |
6766 | 6909 |
6767 The following switches provide additional control over the elaboration | 6910 The following switches provide additional control over the elaboration |
6768 order. For full details see :ref:`Elaboration_Order_Handling_in_GNAT`. | 6911 order. For further details see :ref:`Elaboration_Order_Handling_in_GNAT`. |
6769 | 6912 |
6770 | 6913 |
6771 .. index:: -f (gnatbind) | 6914 .. index:: -f (gnatbind) |
6772 | 6915 |
6773 :switch:`-f{elab-order}` | 6916 :switch:`-f{elab-order}` |
6807 Blank lines and Ada-style comments are ignored. Unit names that do not exist | 6950 Blank lines and Ada-style comments are ignored. Unit names that do not exist |
6808 in the program are ignored. Units in the GNAT predefined library are also | 6951 in the program are ignored. Units in the GNAT predefined library are also |
6809 ignored. | 6952 ignored. |
6810 | 6953 |
6811 | 6954 |
6812 .. index:: -p (gnatbind) | 6955 .. index:: -p (gnatbind) |
6813 | 6956 |
6814 :switch:`-p` | 6957 :switch:`-p` |
6815 Normally the binder attempts to choose an elaboration order that is | 6958 Pessimistic elaboration order |
6816 likely to minimize the likelihood of an elaboration order error resulting | 6959 |
6817 in raising a ``Program_Error`` exception. This switch reverses the | 6960 This switch is only applicable to the pre-20.x legacy elaboration models. |
6818 action of the binder, and requests that it deliberately choose an order | 6961 The post-20.x elaboration model uses a more informed approach of ordering |
6819 that is likely to maximize the likelihood of an elaboration error. | 6962 the units. |
6820 This is useful in ensuring portability and avoiding dependence on | 6963 |
6821 accidental fortuitous elaboration ordering. | 6964 Normally the binder attempts to choose an elaboration order that is likely to |
6822 | 6965 minimize the likelihood of an elaboration order error resulting in raising a |
6823 Normally it only makes sense to use the :switch:`-p` | 6966 ``Program_Error`` exception. This switch reverses the action of the binder, |
6824 switch if dynamic | 6967 and requests that it deliberately choose an order that is likely to maximize |
6968 the likelihood of an elaboration error. This is useful in ensuring | |
6969 portability and avoiding dependence on accidental fortuitous elaboration | |
6970 ordering. | |
6971 | |
6972 Normally it only makes sense to use the :switch:`-p` switch if dynamic | |
6825 elaboration checking is used (:switch:`-gnatE` switch used for compilation). | 6973 elaboration checking is used (:switch:`-gnatE` switch used for compilation). |
6826 This is because in the default static elaboration mode, all necessary | 6974 This is because in the default static elaboration mode, all necessary |
6827 ``Elaborate`` and ``Elaborate_All`` pragmas are implicitly inserted. | 6975 ``Elaborate`` and ``Elaborate_All`` pragmas are implicitly inserted. |
6828 These implicit pragmas are still respected by the binder in | 6976 These implicit pragmas are still respected by the binder in :switch:`-p` |
6829 :switch:`-p` mode, so a | 6977 mode, so a safe elaboration order is assured. |
6830 safe elaboration order is assured. | 6978 |
6831 | 6979 Note that :switch:`-p` is not intended for production use; it is more for |
6832 Note that :switch:`-p` is not intended for | 6980 debugging/experimental use. |
6833 production use; it is more for debugging/experimental use. | |
6834 | 6981 |
6835 .. _Output_Control: | 6982 .. _Output_Control: |
6836 | 6983 |
6837 Output Control | 6984 Output Control |
6838 ^^^^^^^^^^^^^^ | 6985 ^^^^^^^^^^^^^^ |