octave-maintainers
[Top][All Lists]
Advanced

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

Re: Unwarranted old-style cast warning and non-critical error


From: Daniel J Sebald
Subject: Re: Unwarranted old-style cast warning and non-critical error
Date: Thu, 23 Aug 2012 16:18:24 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 08/23/2012 11:33 AM, John W. Eaton wrote:
On 23-Aug-2012, Daniel J Sebald wrote:

| On 08/22/2012 03:37 PM, John W. Eaton wrote:
|>  On 17-Aug-2012, Daniel J Sebald wrote:
|
| [snip]
|
|>  | However, INT_MIN and DBL_MIN are not analogous.  DBL_MIN is the smallest
|>  | positive double value (i.e., greater than zero).  I printed out the value:
|>  |
|>  | DBL_MIN = 2.22507e-308
|>  |
|>  | If the minval is meant to be -DBL_MAX, apparently this doesn't make a
|>  | difference in behavior, otherwise a bug would have shown up long ago.
|>
|>  Right.  I went with -octave_Inf and octave_Inf instead.
|>
|>  I also checked in another change that replaces all uses of DBL_MIN,
|>  DBL_MAX, DBL_EPSILON, FLT_MIN, FLT_MAX, and FLT_EPSILON in C++ code
|>  with std::numeric_limits functions.
|
| That's gotten rid of most of the warnings, but there are several still
| hanging around in the smaller lib subdirectories where there seem to be
| ".in" files that are translated upon ./configure.  Try

OK, I checked in another change for these:

  http://hg.savannah.gnu.org/hgweb/octave/rev/61822c866ba1

All right.  I pulled and update these changes.  I'm compiling from fresh
and redirecting the output to a text file.  When this is complete, I'll
summarize any remaining warnings I'm seeing (see below)...


BTW, I was not seeing warnings about the use of any of these
{FLT,DBL}_{MAX,MIN,EPSILON} macros on my system.  When using C++, they
are apparently defined as

   double(2.22044604925031308085e-16L)

(for example).  When using C, they are defined as ((double)VAL).

What GCC version do you have?

gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)

That's not super recent, but it isn't ancient either.  I read that these
DBL_MAX, etc. warnings were addressed sometime previous to 4.5.1.

Now I'm guessing that it might have something to do with Fedora
configuring the default warning levels of gcc.  The other day when I
built the GUI, I had a barrage of warnings about shadow variables.

Right now, I'm building without the GUI.  Those warnings I'll address if
we clear out all other warnings.  (That way I don't have to separate one
from the other by searching the text file.)

OK, here is what remains:

Makefile:2630: warning: overriding recipe for target `check'
Makefile:2212: warning: ignoring old recipe for target `check'
Makefile:2630: warning: overriding recipe for target `check'
Makefile:2212: warning: ignoring old recipe for target `check'
../../octave/liboctave/CMatrix.cc: In member function 'ComplexMatrix
ComplexMatrix::fourier() const':
../../octave/liboctave/CMatrix.cc:1346:30: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<double>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/CMatrix.cc: In member function 'ComplexMatrix
ComplexMatrix::ifourier() const':
../../octave/liboctave/CMatrix.cc:1387:30: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<double>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/CMatrix.cc: In member function 'ComplexMatrix
ComplexMatrix::fourier2d() const':
../../octave/liboctave/CMatrix.cc:1431:30: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<double>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/CMatrix.cc:1453:30: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<double>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/CMatrix.cc: In member function 'ComplexMatrix
ComplexMatrix::ifourier2d() const':
../../octave/liboctave/CMatrix.cc:1497:30: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<double>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/CMatrix.cc:1522:30: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<double>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/dNDArray.cc: In member function 'ComplexNDArray
NDArray::fourier(int) const':
../../octave/liboctave/dNDArray.cc:260:27: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<double>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/dNDArray.cc: In member function 'ComplexNDArray
NDArray::ifourier(int) const':
../../octave/liboctave/dNDArray.cc:307:27: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<double>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/dNDArray.cc: In member function 'ComplexNDArray
NDArray::fourier2d() const':
../../octave/liboctave/dNDArray.cc:357:31: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<double>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/dNDArray.cc:359:31: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<double>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/dNDArray.cc: In member function 'ComplexNDArray
NDArray::ifourier2d() const':
../../octave/liboctave/dNDArray.cc:405:31: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<double>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/dNDArray.cc:407:31: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<double>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/dNDArray.cc: In member function 'ComplexNDArray
NDArray::fourierNd() const':
../../octave/liboctave/dNDArray.cc:453:31: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<double>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/dNDArray.cc:455:31: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<double>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/dNDArray.cc: In member function 'ComplexNDArray
NDArray::ifourierNd() const':
../../octave/liboctave/dNDArray.cc:500:31: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<double>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/dNDArray.cc:502:31: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<double>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/fCNDArray.cc: In member function
'FloatComplexNDArray FloatComplexNDArray::fourier(int) const':
../../octave/liboctave/fCNDArray.cc:216:35: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<float>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/fCNDArray.cc: In member function
'FloatComplexNDArray FloatComplexNDArray::ifourier(int) const':
../../octave/liboctave/fCNDArray.cc:263:35: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<float>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/fCNDArray.cc: In member function
'FloatComplexNDArray FloatComplexNDArray::fourier2d() const':
../../octave/liboctave/fCNDArray.cc:313:39: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<float>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/fCNDArray.cc:315:39: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<float>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/fCNDArray.cc: In member function
'FloatComplexNDArray FloatComplexNDArray::ifourier2d() const':
../../octave/liboctave/fCNDArray.cc:361:39: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<float>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/fCNDArray.cc:363:39: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<float>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/fCNDArray.cc: In member function
'FloatComplexNDArray FloatComplexNDArray::fourierNd() const':
../../octave/liboctave/fCNDArray.cc:409:39: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<float>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/fCNDArray.cc:411:39: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<float>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/fCNDArray.cc: In member function
'FloatComplexNDArray FloatComplexNDArray::ifourierNd() const':
../../octave/liboctave/fCNDArray.cc:456:39: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<float>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/fCNDArray.cc:458:39: warning:
'Array<T>::Array(octave_idx_type, const T&) [with T =
std::complex<float>, octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:193)
../../octave/liboctave/fNDArray.cc: In member function
'FloatComplexNDArray FloatNDArray::fourier(int) const':
../../octave/liboctave/fNDArray.cc:220:32: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<float>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/fNDArray.cc: In member function
'FloatComplexNDArray FloatNDArray::ifourier(int) const':
../../octave/liboctave/fNDArray.cc:267:32: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<float>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/fNDArray.cc: In member function
'FloatComplexNDArray FloatNDArray::fourier2d() const':
../../octave/liboctave/fNDArray.cc:317:36: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<float>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/fNDArray.cc:319:36: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<float>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/fNDArray.cc: In member function
'FloatComplexNDArray FloatNDArray::ifourier2d() const':
../../octave/liboctave/fNDArray.cc:365:36: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<float>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/fNDArray.cc:367:36: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<float>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/fNDArray.cc: In member function
'FloatComplexNDArray FloatNDArray::fourierNd() const':
../../octave/liboctave/fNDArray.cc:413:36: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<float>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/fNDArray.cc:415:36: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<float>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/fNDArray.cc: In member function
'FloatComplexNDArray FloatNDArray::ifourierNd() const':
../../octave/liboctave/fNDArray.cc:460:36: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<float>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
../../octave/liboctave/fNDArray.cc:462:36: warning:
'Array<T>::Array(octave_idx_type) [with T = std::complex<float>,
octave_idx_type = int]' is deprecated (declared at
../../octave/liboctave/Array.h:187)
conflicts: 16 shift/reduce, 1 reduce/reduce
parse-tree/lex.cc:303:36: warning: use of old-style cast
parse-tree/lex.cc:362:28: warning: use of old-style cast
parse-tree/lex.cc:362:54: warning: use of old-style cast
In file included from lex.ll:79:0:
../../octave/libinterp/parse-tree/octave.gperf: In static member
function 'static unsigned int octave_kw_hash::hash(const char*, unsigned
int)':
../../octave/libinterp/parse-tree/octave.gperf:130:49: warning: use of
old-style cast
../../octave/libinterp/parse-tree/octave.gperf:136:49: warning: use of
old-style cast
parse-tree/lex.cc: In function 'int octave_lex()':
parse-tree/lex.cc:1779:34: warning: use of old-style cast
parse-tree/lex.cc:1779:34: warning: use of old-style cast
parse-tree/lex.cc:1787:53: warning: use of old-style cast
parse-tree/lex.cc:1789:36: warning: use of old-style cast
parse-tree/lex.cc:1791:73: warning: use of old-style cast
parse-tree/lex.cc:1805:3: warning: use of old-style cast
lex.ll:681:1: warning: use of old-style cast
parse-tree/lex.cc:2850:62: warning: use of old-style cast
parse-tree/lex.cc: In function 'int yy_get_next_buffer()':
parse-tree/lex.cc:3016:53: warning: use of old-style cast
parse-tree/lex.cc:3039:39: warning: use of old-style cast
parse-tree/lex.cc:3052:33: warning: use of old-style cast
parse-tree/lex.cc:3052:63: warning: use of old-style cast
parse-tree/lex.cc:3073:3: warning: use of old-style cast
parse-tree/lex.cc:3098:48: warning: use of old-style cast
parse-tree/lex.cc:3101:100: warning: use of old-style cast
parse-tree/lex.cc:3101:120: warning: use of old-style cast
parse-tree/lex.cc: In function 'yy_state_type yy_get_previous_state()':
parse-tree/lex.cc:3127:43: warning: use of old-style cast
parse-tree/lex.cc:3127:43: warning: use of old-style cast
parse-tree/lex.cc:3135:52: warning: use of old-style cast
parse-tree/lex.cc:3137:35: warning: use of old-style cast
parse-tree/lex.cc:3139:72: warning: use of old-style cast
parse-tree/lex.cc: In function 'yy_state_type
yy_try_NUL_trans(yy_state_type)':
parse-tree/lex.cc:3163:51: warning: use of old-style cast
parse-tree/lex.cc:3165:34: warning: use of old-style cast
parse-tree/lex.cc:3167:71: warning: use of old-style cast
parse-tree/lex.cc: In function 'void yyunput(int, char*)':
parse-tree/lex.cc:3194:32: warning: use of old-style cast
parse-tree/lex.cc:3195:32: warning: use of old-style cast
parse-tree/lex.cc:3203:20: warning: use of old-style cast
parse-tree/lex.cc: In function 'int yyinput()':
parse-tree/lex.cc:3276:36: warning: use of old-style cast
parse-tree/lex.cc: In function 'yy_buffer_state*
octave__create_buffer(FILE*, int)':
parse-tree/lex.cc:3357:71: warning: use of old-style cast
parse-tree/lex.cc:3366:59: warning: use of old-style cast
parse-tree/lex.cc: In function 'void
octave__delete_buffer(yy_buffer_state*)':
parse-tree/lex.cc:3388:48: warning: use of old-style cast
parse-tree/lex.cc:3391:27: warning: use of old-style cast
parse-tree/lex.cc:3393:23: warning: use of old-style cast
parse-tree/lex.cc: In function 'void octave_ensure_buffer_stack()':
parse-tree/lex.cc:3523:9: warning: use of old-style cast
parse-tree/lex.cc:3543:9: warning: use of old-style cast
parse-tree/lex.cc: In function 'yy_buffer_state*
octave__scan_buffer(char*, yy_size_t)':
parse-tree/lex.cc:3569:71: warning: use of old-style cast
parse-tree/lex.cc: In function 'yy_buffer_state*
octave__scan_bytes(const char*, int)':
parse-tree/lex.cc:3618:33: warning: use of old-style cast
parse-tree/lex.cc: In function 'int yy_init_globals()':
parse-tree/lex.cc:3755:29: warning: use of old-style cast
parse-tree/lex.cc:3764:26: warning: use of old-style cast
parse-tree/lex.cc:3765:27: warning: use of old-style cast
parse-tree/lex.cc: In function 'void* octave_alloc(yy_size_t)':
parse-tree/lex.cc:3822:31: warning: use of old-style cast
parse-tree/lex.cc: In function 'void* octave_realloc(void*, yy_size_t)':
parse-tree/lex.cc:3834:36: warning: use of old-style cast
parse-tree/lex.cc:3834:46: warning: use of old-style cast
parse-tree/lex.cc: In function 'void octave_free(void*)':
parse-tree/lex.cc:3839:17: warning: use of old-style cast
parse-tree/oct-parse.cc: In function 'int octave_parse()':
parse-tree/oct-parse.cc:2446:64: warning: use of old-style cast
parse-tree/oct-parse.cc:2461:7: warning: use of old-style cast
parse-tree/oct-parse.cc:2504:17: warning: use of old-style cast
../../octave/libinterp/interp-core/display.cc: In member function 'void
display_info::init(bool)':
../../octave/libinterp/interp-core/display.cc:130:32: warning: use of
old-style cast
../../octave/libinterp/interp-core/display.cc:130:32: warning: use of
old-style cast
../../octave/libinterp/interp-core/display.cc:141:34: warning: use of
old-style cast
../../octave/libinterp/interp-core/display.cc:142:34: warning: use of
old-style cast
In file included from ../../octave/libinterp/interp-core/xgl2ps.c:32:0:
../../octave/libinterp/interp-core/gl2ps.c: In function 'gl2psListPointer':
../../octave/libinterp/interp-core/gl2ps.c:573:54: warning: declaration
of 'index' shadows a global declaration
../../octave/libinterp/interp-core/gl2ps.c: In function 'gl2psFindRoot':
../../octave/libinterp/interp-core/gl2ps.c:1409:38: warning: declaration
of 'index' shadows a global declaration
../../octave/libinterp/interp-core/gl2ps.c: In function 'gl2psBuildBspTree':
../../octave/libinterp/interp-core/gl2ps.c:1525:12: warning: declaration
of 'index' shadows a global declaration
../../octave/libinterp/interp-core/gl2ps.c: In function
'gl2psPrintPostScriptBeginViewport':
../../octave/libinterp/interp-core/gl2ps.c:3117:9: warning: declaration
of 'index' shadows a global declaration
../../octave/libinterp/interp-core/gl2ps.c: In function
'gl2psPrintPDFBeginViewport':
../../octave/libinterp/interp-core/gl2ps.c:4761:9: warning: declaration
of 'index' shadows a global declaration
../../octave/libinterp/interp-core/gl2ps.c: In function
'gl2psPrintSVGBeginViewport':
../../octave/libinterp/interp-core/gl2ps.c:5196:9: warning: declaration
of 'index' shadows a global declaration
../../octave/libinterp/interp-core/gl2ps.c: In function
'gl2psPrintPGFBeginViewport':
../../octave/libinterp/interp-core/gl2ps.c:5426:9: warning: declaration
of 'index' shadows a global declaration
../../octave/libinterp/interp-core/gl2ps.c: In function 'gl2psBeginPage':
../../octave/libinterp/interp-core/gl2ps.c:5613:9: warning: declaration
of 'index' shadows a global declaration
../../octave/libinterp/interpfcn/sighandlers.cc: In function 'void
my_friendly_exit(const char*, int, bool)':
../../octave/libinterp/interpfcn/sighandlers.cc:172:43: warning: use of
old-style cast
../../octave/libinterp/interpfcn/sighandlers.cc:198:50: warning: use of
old-style cast
../../octave/libinterp/interpfcn/sighandlers.cc: In function
'octave_interrupt_handler octave_ignore_interrupts()':
../../octave/libinterp/interpfcn/sighandlers.cc:500:59: warning: use of
old-style cast
../../octave/libinterp/interpfcn/sighandlers.cc: In function 'void
install_signal_handlers()':
../../octave/libinterp/interpfcn/sighandlers.cc:594:39: warning: use of
old-style cast
../../octave/libinterp/interpfcn/sighandlers.cc:640:37: warning: use of
old-style cast
../../octave/libinterp/interpfcn/toplev.cc: In function 'int
wait_for_input(int)':
../../octave/libinterp/interpfcn/toplev.cc:761:7: warning: use of
old-style cast
../../octave/libinterp/interpfcn/toplev.cc:761:7: warning: use of
old-style cast
../../octave/libinterp/interpfcn/toplev.cc:761:7: warning: use of
old-style cast
../../octave/libinterp/dldfcn/__delaunayn__.cc: In function
'octave_value_list F__delaunayn__(const octave_value_list&, int)':
../../octave/libinterp/dldfcn/__delaunayn__.cc:184:23: warning: use of
old-style cast
../../octave/libinterp/dldfcn/__init_fltk__.cc:2039:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__init_fltk__.cc:2067:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__magick_read__.cc:404:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__magick_read__.cc:404:1: warning: unused
parameter 'nargout'
../../octave/libinterp/dldfcn/__magick_read__.cc:872:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__magick_read__.cc:1008:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__magick_read__.cc:1160:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__magick_read__.cc:376:1: warning: 'void
maybe_initialize_magick()' defined but not used
../../octave/libinterp/dldfcn/__voronoi__.cc: In function
'octave_value_list F__voronoi__(const octave_value_list&, int)':
../../octave/libinterp/dldfcn/__voronoi__.cc:197:11: warning: use of
old-style cast
../../octave/libinterp/dldfcn/__voronoi__.cc:277:11: warning: use of
old-style cast
../../octave/libinterp/dldfcn/convhulln.cc: In function
'octave_value_list Fconvhulln(const octave_value_list&, int)':
../../octave/libinterp/dldfcn/convhulln.cc:200:15: warning: use of
old-style cast
../../octave/libinterp/dldfcn/convhulln.cc:211:19: warning: use of
old-style cast
../../octave/libinterp/dldfcn/convhulln.cc:218:19: warning: use of
old-style cast
../../octave/libinterp/dldfcn/convhulln.cc:218:19: warning: use of
old-style cast
../../octave/libinterp/dldfcn/convhulln.cc:218:19: warning: use of
old-style cast
In file included from ../../octave/libinterp/dldfcn/eigs.cc:39:0:
../../octave/liboctave/sparse-base-chol.h: In function 'bool
make_cholb(SparseMatrix&, SparseMatrix&, ColumnVector&)':
../../octave/liboctave/sparse-base-chol.h:56:9: warning: 'info' may be
used uninitialized in this function
../../octave/liboctave/eigs-base.cc:368:19: note: 'info' was declared here
../../octave/liboctave/sparse-base-chol.h: In function 'octave_idx_type
EigsComplexNonSymmetricMatrix(const M&, std::string, octave_idx_type,
octave_idx_type, octave_idx_type&, ComplexMatrix&, ComplexColumnVector&,
const M&, ColumnVector&, ComplexColumnVector&, std::ostream&, double,
bool, bool, int, int) [with M = SparseComplexMatrix, octave_idx_type =
int, std::string = std::basic_string<char>, std::ostream =
std::basic_ostream<char>]':
../../octave/liboctave/sparse-base-chol.h:56:9: warning: 'info' may be
used uninitialized in this function
../../octave/liboctave/eigs-base.cc:406:19: note: 'info' was declared here
../../octave/libinterp/dldfcn/__delaunayn__.cc: In function
'octave_value_list F__delaunayn__(const octave_value_list&, int)':
../../octave/libinterp/dldfcn/__delaunayn__.cc:184:23: warning: use of
old-style cast
../../octave/libinterp/dldfcn/__init_fltk__.cc:2039:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__init_fltk__.cc:2067:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__magick_read__.cc:404:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__magick_read__.cc:404:1: warning: unused
parameter 'nargout'
../../octave/libinterp/dldfcn/__magick_read__.cc:872:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__magick_read__.cc:1008:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__magick_read__.cc:1160:1: warning: unused
parameter 'args'
../../octave/libinterp/dldfcn/__magick_read__.cc:376:1: warning: 'void
maybe_initialize_magick()' defined but not used
../../octave/libinterp/dldfcn/__voronoi__.cc: In function
'octave_value_list F__voronoi__(const octave_value_list&, int)':
../../octave/libinterp/dldfcn/__voronoi__.cc:197:11: warning: use of
old-style cast
../../octave/libinterp/dldfcn/__voronoi__.cc:277:11: warning: use of
old-style cast
../../octave/libinterp/dldfcn/convhulln.cc: In function
'octave_value_list Fconvhulln(const octave_value_list&, int)':
../../octave/libinterp/dldfcn/convhulln.cc:200:15: warning: use of
old-style cast
../../octave/libinterp/dldfcn/convhulln.cc:211:19: warning: use of
old-style cast
../../octave/libinterp/dldfcn/convhulln.cc:218:19: warning: use of
old-style cast
../../octave/libinterp/dldfcn/convhulln.cc:218:19: warning: use of
old-style cast
../../octave/libinterp/dldfcn/convhulln.cc:218:19: warning: use of
old-style cast
In file included from ../../octave/libinterp/dldfcn/eigs.cc:39:0:
../../octave/liboctave/sparse-base-chol.h: In function 'bool
make_cholb(SparseMatrix&, SparseMatrix&, ColumnVector&)':
../../octave/liboctave/sparse-base-chol.h:56:9: warning: 'info' may be
used uninitialized in this function
../../octave/liboctave/eigs-base.cc:368:19: note: 'info' was declared here
../../octave/liboctave/sparse-base-chol.h: In function 'octave_idx_type
EigsComplexNonSymmetricMatrix(const M&, std::string, octave_idx_type,
octave_idx_type, octave_idx_type&, ComplexMatrix&, ComplexColumnVector&,
const M&, ColumnVector&, ComplexColumnVector&, std::ostream&, double,
bool, bool, int, int) [with M = SparseComplexMatrix, octave_idx_type =
int, std::string = std::basic_string<char>, std::ostream =
std::basic_ostream<char>]':
../../octave/liboctave/sparse-base-chol.h:56:9: warning: 'info' may be
used uninitialized in this function
../../octave/liboctave/eigs-base.cc:406:19: note: 'info' was declared here

Makefile:2630: warning: overriding recipe for target `check'
Makefile:2212: warning: ignoring old recipe for target `check'


Most of these are what look to be one time C code, stored as an ll file,
converted to a cc file.  In such files it looks like casting 0 to
something is the common warning.  I'd help rid some of these, if you
like.  You'd have to review though.

There are a few easy ones in there like "unused args".

Otherwise, there is some (probably original from years back) C++ code
syntactical issues in one file.  This actually may be more of a concern
than one would think because I see "conflicts: 16 shift/reduce, 1
reduce/reduce".

Also there are some shadowed variables which doesn't look like a major
issue, just that "index" must be declared globally somewhere.  I'm not
seeing it anywhere; most uses of "index" appear to be member variables
or member functions.  And the code that the warnings are coming from is
C code so it can't be shadowing a member variable...warning says
"global" anyway so again, not member.  Is there a function or variable
with name "index" in some library header?

<strings.h> has a function "index".  Perhaps that is the conflict.
Commenting out that header file from gl2ps.c results in those warnings
going away (so yes, it is a conflict with <strings.h>) but of course
then memcpy, strlen, strcpy aren't declared and create other warnings.

So that is it.  I've attached a patch for gl2ps.c which replaces "index"
with "idx" in the offending locations if you want.  ("idx" didn't appear
in gl2ps.c prior to this patch.)

Let's check these:

../../octave/liboctave/sparse-base-chol.h:56:9: warning: 'info' may be
used uninitialized in this function
../../octave/liboctave/eigs-base.cc:368:19: note: 'info' was declared here
../../octave/liboctave/sparse-base-chol.h:56:9: warning: 'info' may be
used uninitialized in this function
../../octave/liboctave/eigs-base.cc:406:19: note: 'info' was declared here

This surely isn't very clean use of "info".  "info" is used as an input
and an output.  I suppose that is why the compiler complains.  It is
difficult to follow this and fix simply.  It is using constructors in a
slightly strange way, which is OK, but by using a variable passed into
the base class constructor as an output complicates my thought pattern.
  Typically, that sort of thing is done with a member variable, i.e.,
the member variable is set by the base class constructor and then just
used in the higher level constructor.

What the "note: 'info' declared here" warning is about, I'm not sure.

In any case, let's save this one for after the other warnings are
addressed because it doesn't give me a warm fuzzy.  Certainly not a
cosmetic fix.  There is also conditional code in the header for which
this function is defined (which means it must be fixed in two places).
Plus, I think that conditional might be better solved with a macro
because what I see as the difference between all these functions is
"Lsparse (0), Common ()", e.g.,

     sparse_base_chol_rep (void)
       : count (1), Lsparse (0), Common (), is_pd (false), minor_p (0),
         perms (), cond (0)
       { }

vs.

     sparse_base_chol_rep (void)
       : count (1), is_pd (false), minor_p (0), perms (), cond (0) { }

or there is slight variation of routines.  Otherwise, 90% of the code
between conditions is shared.

...

Then there are a bunch of warnings related to processing the
documentation, such as:

./plot.texi:97: warning: @image file `plot.txt' (for text) unreadable:
No such file or directory.
./plot.texi:376: warning: @image file `hist.txt' (for text) unreadable:
No such file or directory.
./plot.texi:994: warning: @image file `errorbar.txt' (for text)
unreadable: No such file or directory.
./plot.texi:1168: warning: @image file `polar.txt' (for text)
unreadable: No such file or directory.
./plot.texi:1927: warning: @image file `mesh.txt' (for text) unreadable:
No such file or directory.
./plot.texi:1950: warning: @image file `plot3.txt' (for text)
unreadable: No such file or directory.
./sparse.texi:621: warning: @image file `spmatrix.txt' (for text)
unreadable: No such file or directory.
./sparse.texi:989: warning: @image file `spmatrix.txt' (for text)
unreadable: No such file or directory.
./sparse.texi:1041: warning: @image file `spchol.txt' (for text)
unreadable: No such file or directory.
./sparse.texi:1046: warning: @image file `spcholperm.txt' (for text)
unreadable: No such file or directory.
warning: print.m: epstool binary is not available.
Some output formats are not available.
warning: print.m: pstoedit binary is not available.
Some output formats are not available.

Dan

Attachment: octave-gl2ps_useidx_2012aug23.patch
Description: Text Data


reply via email to

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