From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21331 invoked by alias); 27 Feb 2015 23:33:29 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 21315 invoked by uid 89); 27 Feb 2015 23:33:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ie0-f180.google.com Received: from mail-ie0-f180.google.com (HELO mail-ie0-f180.google.com) (209.85.223.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 27 Feb 2015 23:33:27 +0000 Received: by ierx19 with SMTP id x19so35081862ier.3 for ; Fri, 27 Feb 2015 15:33:25 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.107.30.135 with SMTP id e129mr22445827ioe.26.1425080005092; Fri, 27 Feb 2015 15:33:25 -0800 (PST) Received: by 10.107.136.80 with HTTP; Fri, 27 Feb 2015 15:33:25 -0800 (PST) In-Reply-To: References: <54F0DC99.5020904@redhat.com> Date: Fri, 27 Feb 2015 23:58:00 -0000 Message-ID: Subject: Re: many -Wincompatible-pointer-types on clang with gdb-7.9 From: Jack Howarth To: Pedro Alves Cc: "gdb@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00086.txt.bz2 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 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 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 >>