Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jack Howarth <howarth.mailing.lists@gmail.com>
To: Pedro Alves <palves@redhat.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: many -Wincompatible-pointer-types on clang with gdb-7.9
Date: Fri, 27 Feb 2015 23:58:00 -0000	[thread overview]
Message-ID: <CADtEn-13bHPwQJfQ2KvU4tTiFbZoWHAhirx5bQCEzRKq5aaH-g@mail.gmail.com> (raw)
In-Reply-To: <CADtEn-2orLcoUSem5RuK3LwF-RGauC8LXv8xZem0tGJsDwg0iA@mail.gmail.com>

The proposed patch doesn't eliminate the warnings...

./guile/scm-arch.c:498:40: warning: incompatible pointer types
initializing 'scm_t_subr' (aka 'void (*)()') with an expression of
type 'SCM (SCM)'
      [-Wincompatible-pointer-types]
  { "arch?", 1, 0, 0, as_a_scm_t_subr (gdbscm_arch_p),
                                       ^~~~~~~~~~~~~
./guile/guile-internal.h:93:31: note: expanded from macro 'as_a_scm_t_subr'
#define as_a_scm_t_subr(func) func
                              ^

On Fri, Feb 27, 2015 at 6:23 PM, Jack Howarth
<howarth.mailing.lists@gmail.com> wrote:
> Pedro,
>      I see...
>
> #ifdef BUILDING_LIBGUILE
> typedef SCM (* scm_t_subr) ();
> #else
> typedef void (*scm_t_subr)();
> #endif
>
> for the current guile 2.0.11 release.
>
> On Fri, Feb 27, 2015 at 4:07 PM, Pedro Alves <palves@redhat.com> wrote:
>> On 02/27/2015 06:55 PM, Jack Howarth wrote:
>>> On gdb-7.9, we are seeing a large number of warnings from
>>> -Wincompatible-pointer-types with clang...
>>>
>>> ./guile/guile.c:474:25: warning: incompatible pointer types
>>> initializing 'scm_t_subr' (aka 'void (*)()') with an expression of
>>> type 'SCM (SCM, SCM)'
>>>       [-Wincompatible-pointer-types]
>>>   { "execute", 1, 0, 1, gdbscm_execute_gdb_command,
>>>                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>> ./guile/guile.c:487:32: warning: incompatible pointer types
>>> initializing 'scm_t_subr' (aka 'void (*)()') with an expression of
>>> type 'SCM (void)'
>>>       [-Wincompatible-pointer-types]
>>>   { "data-directory", 0, 0, 0, gdbscm_data_directory,
>>>                                ^~~~~~~~~~~~~~~~~~~~~
>>> ./guile/guile.c:491:38: warning: incompatible pointer types
>>> initializing 'scm_t_subr' (aka 'void (*)()') with an expression of
>>> type 'SCM (void)'
>>>       [-Wincompatible-pointer-types]
>>>   { "guile-data-directory", 0, 0, 0, gdbscm_guile_data_directory,
>>>                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>
>>> These all are associated with the guile/scm-*.c files.
>>>            Jack
>>>
>>
>> Curious.  I see that on C++ mode too.
>>
>> I've attached my current patch to address this.  I think you'll
>> just need to do something like this on top:
>>
>>  #else
>>
>>  /* In C, just do an implicit conversion.  */
>>  -#define as_a_scm_t_subr(func) func
>>  +#define as_a_scm_t_subr(func) (scm_t_subr) func
>>
>>  #endif
>>
>>
>> Did guile change the type of scm_t_subr again?
>> Here it says 'void (*)()' :
>>
>>> initializing 'scm_t_subr' (aka 'void (*)()') with an expression of
>>> type 'SCM (SCM, SCM)'
>>
>> On my copy (guile 2.0, Fedora 20), in
>> /usr/include/guile/2.0/libguile/__scm.h, I see:
>>
>> #ifdef BUILDING_LIBGUILE
>> typedef SCM (* scm_t_subr) ();
>> #else
>> typedef void *scm_t_subr;
>> #endif
>>
>> Thanks,
>> Pedro Alves
>>


  reply	other threads:[~2015-02-27 23:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 23:23 Jack Howarth
2015-02-27 23:33 ` Pedro Alves
2015-02-27 23:54   ` Jack Howarth
2015-02-27 23:58     ` Jack Howarth [this message]
2015-02-28  6:13       ` Pedro Alves
2015-02-28  7:28     ` Pedro Alves

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=CADtEn-13bHPwQJfQ2KvU4tTiFbZoWHAhirx5bQCEzRKq5aaH-g@mail.gmail.com \
    --to=howarth.mailing.lists@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=palves@redhat.com \
    /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