This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC] ada: Make Interfaces.C.Strings.chars_ptr a C convention type
- From: Samuel Tardieu <sam at rfc1149 dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 11 Nov 2007 14:22:05 +0100
- Subject: [RFC] ada: Make Interfaces.C.Strings.chars_ptr a C convention type
- Organisation: RFC1149 (see http://www.rfc1149.net/)
GNAT issues a warning when Unchecked_Conversion is instantiated with a
C convention access pointer and an Interfaces.Strings.chars_ptr, which
must be C compatible. This patch removes the warning by making chars_ptr
explicitely use convention C.
This is an RFC as I'd like to make sure that this is allowed to use
a Convention pragma on a language-defined private type.
gcc/ada
PR ada/33988
* i-cstrin.ads: Make chars_ptr a C convention type to avoid
a GNAT warning when converting it to or from a C convention
about different conventions being used.
---
gcc/ada/i-cstrin.ads | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gcc/ada/i-cstrin.ads b/gcc/ada/i-cstrin.ads
index 5ea063a..5e3494e 100644
--- a/gcc/ada/i-cstrin.ads
+++ b/gcc/ada/i-cstrin.ads
@@ -97,6 +97,7 @@ package Interfaces.C.Strings is
private
type chars_ptr is access all Character;
+ pragma Convention (C, chars_ptr);
pragma No_Strict_Aliasing (chars_ptr);
-- Since this type is used for external interfacing, with the pointer
--
1.5.3.5