octave-maintainers
[Top][All Lists]
Advanced

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

warnings originating in gl2ps -- update


From: John W. Eaton
Subject: warnings originating in gl2ps -- update
Date: Thu, 10 Feb 2011 00:35:23 -0500

On  9-Feb-2011, Larry Doolittle wrote:

| Others (Hi, José!) have observed that octave-3.4.0 builds
| with a moderate number of warnings when using a "modern"
| c compiler.  My tests use Debian squeeze's stock gcc-4.4.5.

Apart from the warnings with gl2ps.c, we have the following warnings
when using fairly strict warning flags with GCC (-Wall -W -Wshadow
-Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align
-Wcast-qual):

  85 use of old-style cast
  19 comparison between signed and unsigned integer expressions
   8 shadowed declaration is here
   2 'void Array<T>::resize(octave_idx_type, octave_idx_type, const T&) [with T 
= int]' is deprecated (declared at ../liboctave/Array.h:456)
   2 unused parameter 'id'
   1 unused parameter 'args'
   1 no return statement in function returning non-void
   1 function declared 'noreturn' has a 'return' statement

The last time I checked, all the "old-style cast" warnings are coming
from C-language system header files or flex/bison generated code that
we have no control over.  I'm not sure what to do about the comparison
for signed and unsigned integer expressions.  Most of those have to do
with Octave using a signed integer for its indexing type for
compatibility with Fortran code that we call, while C/C++ uses the
unsigned size_t type.  I'll take a look at the shadowed declaration
and deprecated function warnings, as I wasn't aware of them until now.
The unused parameter id warnings occur in C code, so we can't simply
omit the parameter name.  I'll fix the unused parameter 'args'
warning.  I don't know how to eliminate the warnings about return
statements.

If you have suggestions about how to fix the remaining problems, then
submit a patch.  But I think we are in pretty good shape.

Pascal Dupuis was working on eliminating warnings that happen with
-Weffc++, and that's OK with me, but it should be done with some care,
as I think there are ways to avoid some of those warnings that don't
really improve the code.

| Many of these warnings come from gl2ps.c, which I checked is
| an up-to-date copy of upstream's svn repository.  I investigated
| all these warnings; they are both innocuous and easy to patch.
| I sent my patches upstream.  If anyone wants to check my work,
| you can fetch my patches from
|    http://recycle.lbl.gov/~ldoolitt/gl2ps.patch1

Thanks for doing this.  I'd been meaning to look into it myself but
have not had the time.

jwe


reply via email to

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