octave-maintainers
[Top][All Lists]
Advanced

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

Re: gcc7 warnings


From: John W. Eaton
Subject: Re: gcc7 warnings
Date: Fri, 28 Apr 2017 11:57:12 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0

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 via email to

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