Commit 07ec36ee by Eric Botcazou Committed by Pierre-Marie de Rodat

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