Re: many -Wincompatible-pointer-types on clang with gdb-7.9
Pedro Alves <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
On 02/27/2015 11:33 PM, Jack Howarth wrote:
> 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
> ^
That's because you didn't fully try what I suggested. :-)
Here is is again:
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
That's basically the same as adding a cast everywhere...
Thanks,
Pedro Alves