[Ada] Document that boolean types with convention C now map to C99 bool
2019-07-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * doc/gnat_rm/interfacing_to_other_languages.rst (Interfacing to C): Document that boolean types with convention C now map to C99 bool. * gnat_rm.texi: Regenerate. From-SVN: r272960
This commit is contained in:
parent
4a51756a8c
commit
07ec36eed9
|
@ -1,3 +1,9 @@
|
|||
2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* doc/gnat_rm/interfacing_to_other_languages.rst (Interfacing to C):
|
||||
Document that boolean types with convention C now map to C99 bool.
|
||||
* gnat_rm.texi: Regenerate.
|
||||
|
||||
2019-07-03 Javier Miranda <miranda@adacore.com>
|
||||
|
||||
* exp_attr.adb (Expand_Min_Max_Attribute): Code cleanup:
|
||||
|
|
|
@ -46,8 +46,10 @@ and C types:
|
|||
|
||||
*
|
||||
Ada enumeration types map to C enumeration types directly if pragma
|
||||
``Convention C`` is specified, which causes them to have int
|
||||
length. Without pragma ``Convention C``, Ada enumeration types map to
|
||||
``Convention C`` is specified, which causes them to have a length of
|
||||
32 bits, except for boolean types which map to C99 ``bool`` and for
|
||||
which the length is 8 bits.
|
||||
Without pragma ``Convention C``, Ada enumeration types map to
|
||||
8, 16, or 32 bits (i.e., C types ``signed char``, ``short``,
|
||||
``int``, respectively) depending on the number of values passed.
|
||||
This is the only case in which pragma ``Convention C`` affects the
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
@copying
|
||||
@quotation
|
||||
GNAT Reference Manual , May 27, 2019
|
||||
GNAT Reference Manual , Jun 21, 2019
|
||||
|
||||
AdaCore
|
||||
|
||||
|
@ -5220,18 +5220,19 @@ Syntax:
|
|||
pragma Machine_Attribute (
|
||||
[Entity =>] LOCAL_NAME,
|
||||
[Attribute_Name =>] static_string_EXPRESSION
|
||||
[, [Info =>] static_EXPRESSION] );
|
||||
[, [Info =>] static_EXPRESSION @{, static_EXPRESSION@}] );
|
||||
@end example
|
||||
|
||||
Machine-dependent attributes can be specified for types and/or
|
||||
declarations. This pragma is semantically equivalent to
|
||||
@code{__attribute__((@emph{attribute_name}))} (if @code{info} is not
|
||||
specified) or @code{__attribute__((@emph{attribute_name(info})))}
|
||||
in GNU C, where @emph{attribute_name} is recognized by the
|
||||
compiler middle-end or the @code{TARGET_ATTRIBUTE_TABLE} machine
|
||||
specific macro. A string literal for the optional parameter @code{info}
|
||||
is transformed into an identifier, which may make this pragma unusable
|
||||
for some attributes.
|
||||
or @code{__attribute__((@emph{attribute_name(info,...})))} in GNU C,
|
||||
where @emph{attribute_name} is recognized by the compiler middle-end
|
||||
or the @code{TARGET_ATTRIBUTE_TABLE} machine specific macro. Note
|
||||
that a string literal for the optional parameter @code{info} or the
|
||||
following ones is transformed by default into an identifier,
|
||||
which may make this pragma unusable for some attributes.
|
||||
For further information see @cite{GNU Compiler Collection (GCC) Internals}.
|
||||
|
||||
@node Pragma Main,Pragma Main_Storage,Pragma Machine_Attribute,Implementation Defined Pragmas
|
||||
|
@ -25540,8 +25541,10 @@ and C types:
|
|||
|
||||
@item
|
||||
Ada enumeration types map to C enumeration types directly if pragma
|
||||
@code{Convention C} is specified, which causes them to have int
|
||||
length. Without pragma @code{Convention C}, Ada enumeration types map to
|
||||
@code{Convention C} is specified, which causes them to have a length of
|
||||
32 bits, except for boolean types which map to C99 @code{bool} and for
|
||||
which the length is 8 bits.
|
||||
Without pragma @code{Convention C}, Ada enumeration types map to
|
||||
8, 16, or 32 bits (i.e., C types @code{signed char}, @code{short},
|
||||
@code{int}, respectively) depending on the number of values passed.
|
||||
This is the only case in which pragma @code{Convention C} affects the
|
||||
|
|
Loading…
Reference in New Issue