public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sam at rfc1149 dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/33988]  New: Warning when converting between C compatible pointers
Date: Sat, 03 Nov 2007 16:37:00 -0000	[thread overview]
Message-ID: <bug-33988-15252@http.gcc.gnu.org/bugzilla/> (raw)

The RM95 B.3.1 contains: "The type chars_ptr is C-compatible and
corresponds to the use of C's ``char *'' for a pointer to the first char
in a char array terminated by nul.".

Doesn't it imply that it has a C convention, or at least that it can be
converted to an access type with convention C without warranting a
warning? When compiling the following test with GCC trunk and -Wall, I get:

t.ads:10:04: warning: conversion between pointers with different conventions

(I know the following code looks strange, but it is a specially built
test case following a more complex case found in AdaSockets)

--
with Ada.Unchecked_Conversion;
with Interfaces.C.Strings;

package T is

   type P is access Integer;
   pragma Convention (C, P);

   function Convert is
      new Ada.Unchecked_Conversion (Interfaces.C.Strings.chars_ptr, P);

end T;


-- 
           Summary: Warning when converting between C compatible pointers
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sam at rfc1149 dot net
  GCC host triplet: i386-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33988


             reply	other threads:[~2007-11-03 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-03 16:37 sam at rfc1149 dot net [this message]
2007-11-11 12:35 ` [Bug ada/33988] " sam at rfc1149 dot net
2007-11-14 22:15 ` sam at rfc1149 dot net
2007-12-05 12:38 ` sam at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-33988-15252@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).