[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compiler warnings

From: David Kastrup
Subject: Re: compiler warnings
Date: Fri, 03 Oct 2014 23:58:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Werner LEMBERG <address@hidden> writes:

> [release/2.19.15-1-13-gdd5a6e7]
> [gcc 4.7.2]
> Compiling lilypond, I now get zillions of warnings like this:
>   In file included from ./include/smobs.hh:315:0,
>                    from ./include/box.hh:10,
>                    from ./include/font-metric.hh:23,
>                    from ./include/font-interface.hh:23,
>                    from
>   ./include/smobs.tcc: In instantiation of
>      'static void Smob_base<Super>::init() [with Super = 
> Unpure_pure_container]':
>   ./include/smobs.tcc:83:10:   required from
>      'Scm_init Smob_base<Unpure_pure_container>::scm_init_'
>   ./include/smobs.hh:160:35:   required from
>      'static scm_t_bits Smob_base<Super>::smob_tag()
>      [with Super = Unpure_pure_container; scm_t_bits = long unsigned int]'
>   ./include/small-smobs.hh:52:5:   required from
>      'static scm_unused_struct* Smob2<Super>::make_smob(SCM, SCM)
>      [with Super = Unpure_pure_container; SCM = scm_unused_struct*]'
>   ./include/unpure-pure-container.hh:39:44:   required from here
>   ./include/smobs.tcc:110:3: warning: the address of
>     'static int Unpure_pure_container::print_smob(SCM, SCM, scm_print_state*)'
>     will never be NULL [-Waddress]
> Any chance to fix that?

I don't get the warnings here (gcc 4.8.2).  For print_smob particularly,
it may be feasible to remove the line

    if (Super::print_smob != 0)

in lily/include/smobs.hh.  Can you check whether this solves your
problem or whether warnings for other functions remain?  The problem is
that all of the expressions here are supposed to be constant expressions
depending on the particular template type.  It is ok if the comparisons
are optimized away, but for all of the other comparisons rather than
print_smob, the constant expression will be different for different
types of Super.

David Kastrup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]