Name |
Last commit
|
Last update |
---|---|---|
.. | ||
Make-lang.in | ||
Makefile.in | ||
ada-tree.def | ||
ada-tree.h | ||
ada.h | ||
config-lang.in | ||
cuintp.c | ||
decl.c | ||
gadaint.h | ||
gigi.h | ||
lang-specs.h | ||
lang.opt | ||
misc.c | ||
targtyps.c | ||
trans.c | ||
utils.c | ||
utils2.c |
This change the type Interfaces.C.Extensions.bool to be fully compatible with the C99 and C++ standard boolean types by making it a fully-fledged boolean type with convention C. The following C+Ada program must compile quietly in LTO mode: bool b; struct S {}; bool foo (struct S *s) { return true; } pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with Interfaces.C.Extensions; package t_c is b : aliased Extensions.bool; -- t.c:3 pragma Import (C, b, "b"); type S is record null; end record; pragma Convention (C_Pass_By_Copy, S); -- t.c:5 function foo (the_s : access S) return Extensions.bool; -- t.c:7 pragma Import (C, foo, "foo"); end t_c; with t_c; use t_c; procedure P_C is Dummy : aliased S; begin b := foo (Dummy'Access); end; 2018-05-25 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * freeze.adb (Freeze_Enumeration_Type): Do not give integer size to a boolean type with convention C. * libgnat/i-cexten.ads (bool): Change to boolean with convention C. * gcc-interface/decl.c (gnat_to_gnu_entity): Add new local variable FOREIGN and use it throughout the function. <E_Enumeration_Type>: Set precision 1 on boolean types with foreign convention. <E_Enumeration_Subtype>: Likewise for subtypes. <E_Record_Type>: Force the size of a storage unit on empty classes. * gcc-interface/utils.c (make_type_from_size) <BOOLEAN_TYPE>: Skip boolean types with precision 1 if the size is the expected one. From-SVN: r260721
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
Make-lang.in | Loading commit data... | |
Makefile.in | Loading commit data... | |
ada-tree.def | Loading commit data... | |
ada-tree.h | Loading commit data... | |
ada.h | Loading commit data... | |
config-lang.in | Loading commit data... | |
cuintp.c | Loading commit data... | |
decl.c | Loading commit data... | |
gadaint.h | Loading commit data... | |
gigi.h | Loading commit data... | |
lang-specs.h | Loading commit data... | |
lang.opt | Loading commit data... | |
misc.c | Loading commit data... | |
targtyps.c | Loading commit data... | |
trans.c | Loading commit data... | |
utils.c | Loading commit data... | |
utils2.c | Loading commit data... |