oct-stream.cc:3495:42: note: did you mean to use logical not (‘!’)?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

oct-stream.cc:3495:42: note: did you mean to use logical not (‘!’)?

Dmitri A. Sergatskov
One of the gcc7 warnings:

/bin/sh ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../src  -Iliboctave -I../src/liboctave -I../src/liboctave/array -Iliboctave/numeric -I../src/liboctave/numeric -Iliboctave/operators -I../src/liboctave/operators -I../src/liboctave/system -I../src/liboctave/util -I../src/libinterp/octave-value -Ilibinterp -I../src/libinterp -I../src/libinterp/operators -Ilibinterp/parse-tree -I../src/libinterp/parse-tree -Ilibinterp/corefcn -I../src/libinterp/corefcn -I../src/liboctave/wrappers  -I/usr/include/GraphicsMagick   -I/usr/include/freetype2 -I/usr/include/libpng16  -I/usr/include/freetype2 -I/usr/include/libpng16      -fPIC -pthread -fopenmp -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual  -g -O2 -MT libinterp/corefcn/libinterp_corefcn_libcorefcn_la-pager.lo -MD -MP -MF libinterp/corefcn/.deps/libinterp_corefcn_libcorefcn_la-pager.Tpo -c -o libinterp/corefcn/libinterp_corefcn_libcorefcn_la-pager.lo `test -f 'libinterp/corefcn/pager.cc' || echo '../src/'`libinterp/corefcn/pager.cc
../src/libinterp/corefcn/oct-stream.cc: In member function ‘int octave::textscan::read_format_once(octave::delimited_stream&, octave::textscan_format_list&, std::__cxx11::list<octave_value>&, Array<long int>, int&)’:
../src/libinterp/corefcn/oct-stream.cc:3495:42: warning: ‘~’ on an expression of type bool [-Wbool-operation]
             if (! is.eof () && ~is_delim (is.peek ()))
                                 ~~~~~~~~~^~~~~~~~~~~~
../src/libinterp/corefcn/oct-stream.cc:3495:42: note: did you mean to use logical not (‘!’)?

Not sure how valid or serious it is...

Dmitri.
--

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oct-stream.cc:3495:42: note: did you mean to use logical not (‘!’)?

John W. Eaton
Administrator
On 07/24/2017 01:38 PM, Dmitri A. Sergatskov wrote:

> One of the gcc7 warnings:
>
> /bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I.
> -I../src -Iliboctave -I../src/liboctave -I../src/liboctave/array
> -Iliboctave/numeric -I../src/liboctave/numeric -Iliboctave/operators
> -I../src/liboctave/operators -I../src/liboctave/system
> -I../src/liboctave/util -I../src/libinterp/octave-value -Ilibinterp
> -I../src/libinterp -I../src/libinterp/operators -Ilibinterp/parse-tree
> -I../src/libinterp/parse-tree -Ilibinterp/corefcn
> -I../src/libinterp/corefcn -I../src/liboctave/wrappers
> -I/usr/include/GraphicsMagick -I/usr/include/freetype2
> -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16
> -fPIC -pthread -fopenmp -Wall -W -Wshadow -Wold-style-cast -Wformat
> -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -MT
> libinterp/corefcn/libinterp_corefcn_libcorefcn_la-pager.lo -MD -MP -MF
> libinterp/corefcn/.deps/libinterp_corefcn_libcorefcn_la-pager.Tpo -c -o
> libinterp/corefcn/libinterp_corefcn_libcorefcn_la-pager.lo `test -f
> 'libinterp/corefcn/pager.cc' || echo
> '../src/'`libinterp/corefcn/pager.cc
> ../src/libinterp/corefcn/oct-stream.cc: In member function ‘int
> octave::textscan::read_format_once(octave::delimited_stream&,
> octave::textscan_format_list&, std::__cxx11::list<octave_value>&,
> Array<long int>, int&)’: ../src/libinterp/corefcn/oct-stream.cc:3495:42:
> warning: ‘~’ on an expression of type bool [-Wbool-operation] if (!
> is.eof () && ~is_delim (is.peek ())) ~~~~~~~~~^~~~~~~~~~~~
> ../src/libinterp/corefcn/oct-stream.cc:3495:42: note: did you mean to
> use logical not (‘!’)?
>
> Not sure how valid or serious it is...

Given that is_delim returns a bool, I'd guess it should be !, not ~.

I pushed this changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/0fb64e83f8b3

jwe

Loading...