gcc7 warnings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

gcc7 warnings

Dmitri A. Sergatskov
I have been compiling octave dev on Fedora-26 (alpha) that has gcc7 (and few other newer tools), and while it works just fine there are few extra warning which i do not see
on the Fedora 25 (current release gcc 6.3.1):

* Quite a few of type:
<<<<
../liboctave/operators/mx-inlines.cc:582:1: warning: mangled name for ‘bool do_mx_check(const Array<T>&, bool (*)(size_t, const T*) throw ()) [with T = octave_int<short unsigned int>]’ will change in C++17 because the exception specification is part of a function type [-Wnoexcept-type]
>>>>
those are, I assume, bening

* Few of -Wimplicit-fallthrough which look more serious
(
https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
) E.g.:

<<<<
../libinterp/octave-value/ov-classdef.cc: In member function ‘virtual octave_value_list cdef_object_array::subsref(const string&, const std::__cxx11::list<octave_value_list>&, int, size_t&, const cdef_class&, bool)’:
../libinterp/octave-value/ov-classdef.cc:1552:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
         }
         ^
../libinterp/octave-value/ov-classdef.cc:1555:5: note: here
     default:
     ^~~~~~~
>>>>

* Few  of "-Wint-in-bool-context" like (also look bening to me):

<<<<
../libinterp/octave-value/ov-typeinfo.cc: In static member function ‘static bool octave_value_typeinfo::register_assign_op(octave_value::assign_op, int, int, octave_value_typeinfo::assign_op_fcn)’:
../libinterp/octave-value/ov-typeinfo.cc:142:10: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
   return (instance_ok ())
          ~~~~~~~~~~~~~~~~
          ? instance->do_register_assign_op (op, t_lhs, t_rhs, f) : -1;
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libinterp/octave-value/ov-typeinfo.cc: In static member function ‘static bool octave_value_typeinfo::register_assignany_op(octave_value::assign_op, int, octave_value_typeinfo::assignany_op_fcn)’:
../libinterp/octave-value/ov-typeinfo.cc:150:10: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
   return (instance_ok ())
          ~~~~~~~~~~~~~~~~
          ? instance->do_register_assignany_op (op, t_lhs, f) : -1;
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 >>>>

If there is an interest, I can post all of them.
On related subject, if there is an interest, I should be able to update Fedora buildbot
to F26 sooner rather than later.

Dmitri.
 
Reply | Threaded
Open this post in threaded view
|

Re: gcc7 warnings

John W. Eaton
Administrator
On 04/28/2017 12:08 AM, Dmitri A. Sergatskov wrote:

> I have been compiling octave dev on Fedora-26 (alpha) that has gcc7 (and
> few other newer tools), and while it works just fine there are few extra
> warning which i do not see
> on the Fedora 25 (current release gcc 6.3.1):
>
> * Quite a few of type:
> <<<<
> ../liboctave/operators/mx-inlines.cc:582:1: warning: mangled name for
> ‘bool do_mx_check(const Array<T>&, bool (*)(size_t, const T*) throw ())
> [with T = octave_int<short unsigned int>]’ will change in C++17 because
> the exception specification is part of a function type [-Wnoexcept-type]
>>>>>
> those are, I assume, bening

Yes, the throw() should either be replaced by a noexcept attribute or
just removed.

> * Few of -Wimplicit-fallthrough which look more serious
> (
> https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
> ) E.g.:
>
> <<<<
> ../libinterp/octave-value/ov-classdef.cc: In member function ‘virtual
> octave_value_list cdef_object_array::subsref(const string&, const
> std::__cxx11::list<octave_value_list>&, int, size_t&, const cdef_class&,
> bool)’:
> ../libinterp/octave-value/ov-classdef.cc:1552:9: warning: this statement
> may fall through [-Wimplicit-fallthrough=]
>          }
>          ^
> ../libinterp/octave-value/ov-classdef.cc:1555:5: note: here
>      default:
>      ^~~~~~~

These should probably be checked to see whether we really intend for the
code to fall through to the next switch case, and if so, tag them with
the [[fallthrough]] attribute.  But since we don't assume C++17 yet, I
guess this should be done with a macro and a configure test to see
whether [[fallthrough]] is supported.

> * Few  of "-Wint-in-bool-context" like (also look bening to me):
>
> <<<<
> ../libinterp/octave-value/ov-typeinfo.cc: In static member function
> ‘static bool
> octave_value_typeinfo::register_assign_op(octave_value::assign_op, int,
> int, octave_value_typeinfo::assign_op_fcn)’:
> ../libinterp/octave-value/ov-typeinfo.cc:142:10: warning: ?: using
> integer constants in boolean context [-Wint-in-bool-context]
>    return (instance_ok ())
>           ~~~~~~~~~~~~~~~~
>           ? instance->do_register_assign_op (op, t_lhs, t_rhs, f) : -1;
>           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../libinterp/octave-value/ov-typeinfo.cc: In static member function
> ‘static bool
> octave_value_typeinfo::register_assignany_op(octave_value::assign_op,
> int, octave_value_typeinfo::assignany_op_fcn)’:
> ../libinterp/octave-value/ov-typeinfo.cc:150:10: warning: ?: using
> integer constants in boolean context [-Wint-in-bool-context]
>    return (instance_ok ())
>           ~~~~~~~~~~~~~~~~
>           ? instance->do_register_assignany_op (op, t_lhs, f) : -1;
>           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I checked in the following changeset for these warnings:

   http://hg.savannah.gnu.org/hgweb/octave/rev/e4fca7cc471c

Are there more?

> If there is an interest, I can post all of them.

Yes, please.

> On related subject, if there is an interest, I should be able to update
> Fedora buildbot
> to F26 sooner rather than later.

OK.  Should we continue testing on the previous version?  If so, I could
maybe set up a VM to do it.

jwe


Reply | Threaded
Open this post in threaded view
|

Re: gcc7 warnings

Dmitri A. Sergatskov
On Fri, Apr 28, 2017 at 10:57 AM, John W. Eaton <[hidden email]> wrote:



OK.  Should we continue testing on the previous version?  If so, I could maybe set up a VM to do it.

​Fedora 26 is scheduled to be released at the end of June. Fedora 25 will get off support 14 month
from that point. Officially it still has octave 4.0.3 as an "official"  version.
gcc6 toolchain is checked by debian's buildbots. I really see little value in having  buildbot for both
Fedora 25 and 26 at the same time.

 

jwe



​Dmitri.
--