Re: Warnings during build

From: Dave Hill (dave@minnie.demon.co.uk)
Date: Tue Aug 08 2000 - 04:59:58 PDT

  • Next message: Jonathan P. Dietrich: "Re: insane sane problems :)"

    Henning Meier-Geinitz wrote:
    >
    > Hi,
    >
    > On Mon, Aug 07, 2000 at 05:00:58PM +0100, Dave Hill wrote:

    [snip]

    > > This is with the warnings turned
    > > down (if I try to build with the warnings turned up, it fails!).
    >
    > This shouldn't happen. Where does it fail? Could you send the output of make
    > (or whatever fails)?
    >

    It fails whilst compiling "canon.c". The compiler is:-
    $ gcc -v
    Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
    gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

    This is what happens:-

    gcc -c -g -O2 -W -Wall -Wstrict-prototypes -Wreturn-type -Wcast-align
    -Wpointer-arith -Wcast-qual -ansi -pedantic -DSCSIBUFFERSIZE=131072
    -DHAVE_CONFIG_H -I. -I. -I../include -I../include -D_GNU_SOURCE
    -DPATH_SANE_CONFIG_DIR=/etc/sane.d -DPATH_SANE_DATA_DIR=/usr/share/sane
    -DV_MAJOR=1 -DV_MINOR=0 -DBACKEND_NAME=canon -DLIBDIR=/usr/lib/sane
    canon.c -fPIC -DPIC -o .libs/canon.lo
    In file included from ../include/sane/sanei_backend.h:1,
                     from canon.c:105:
    ../include/sane/sanei_debug.h:46: warning: ANSI C does not allow macro
    with variable arguments
    /usr/include/bits/mathinline.h: In function `__signbitf':
    In file included from /usr/include/math.h:348,
                     from canon.c:97:
    /usr/include/bits/mathinline.h:117: warning: ANSI C forbids specifying
    structure member to initialize
    /usr/include/bits/mathinline.h:117: initializer element for `__u.__f' is
    not computable at load time
    /usr/include/bits/mathinline.h: In function `__signbit':
    /usr/include/bits/mathinline.h:122: warning: ANSI C forbids specifying
    structure member to initialize
    /usr/include/bits/mathinline.h:122: initializer element for `__u.__d' is
    not computable at load time
    /usr/include/bits/mathinline.h: In function `__signbitl':
    /usr/include/bits/mathinline.h:127: warning: ANSI C forbids specifying
    structure member to initialize
    /usr/include/bits/mathinline.h:127: initializer element for `__u.__l' is
    not computable at load time
    canon-scsi.c: In function `define_scan_mode':
    In file included from canon.c:181:
    canon-scsi.c:382: warning: comparison between signed and unsigned
    canon-scsi.c: In function `set_density_curve':
    canon-scsi.c:445: warning: unused parameter `buf_size'
    canon.c: In function `get_tpu_stat':
    canon.c:231: warning: comparison between signed and unsigned
    canon.c: In function `get_adf_stat':
    canon.c:285: warning: comparison between signed and unsigned
    canon.c: In function `attach':
    canon.c:599: warning: comparison between signed and unsigned
    canon.c: In function `adjust_hilo_points':
    canon.c:1128: warning: comparison between signed and unsigned
    canon-sane.c: In function `sane_canon_init':
    In file included from canon.c:1937:
    canon-sane.c:4: warning: unused parameter `authorize'
    canon-sane.c: In function `sane_canon_exit':
    canon-sane.c:54: warning: cast discards `const' from pointer target type
    canon-sane.c:55: warning: cast discards `const' from pointer target type
    canon-sane.c: In function `sane_canon_get_devices':
    canon-sane.c:65: warning: unused parameter `local_only'
    canon-sane.c: In function `sane_canon_control_option':
    canon-sane.c:601: warning: pointer of type `void *' used in arithmetic

    [snip more of these]

    canon-sane.c: In function `sane_canon_start':
    canon-sane.c:1070: warning: comparison between signed and unsigned
    canon-sane.c:1086: warning: comparison between signed and unsigned
    canon-sane.c:1296: warning: comparison between signed and unsigned
    canon-sane.c: In function `sane_canon_set_io_mode':
    canon-sane.c:1395: warning: unused parameter `handle'
    canon-sane.c:1395: warning: unused parameter `non_blocking'
    canon-sane.c: In function `sane_canon_get_select_fd':
    canon-sane.c:1406: warning: unused parameter `handle'
    canon-sane.c:1406: warning: unused parameter `fd'
    make[1]: *** [canon.lo] Error 1
    make[1]: Leaving directory
    `/home/src/redhat/BUILD/sane-1.0.2_20000806/backend'
    make: *** [all-recursive] Error 1

    I think that the problem is with the include files, rather than the
    actual backend itself, as all it does is to #include <math.h>!

    The code in <math.h> says:-

    /* Get machine-dependent inline versions (if there are any). */
    #ifdef __USE_EXTERN_INLINES
    # include <bits/mathinline.h>
    #endif

    and __USE_EXTERN_INLINES is set in <features.h> like this:-

    /* Decide whether we can define 'extern inline' functions in headers.
    */
    #if defined __GNUC__ && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__
    >= 7)\
        && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__
    # define __USE_EXTERN_INLINES 1
    #endif

    Obviously the code in <bits/mathinline.h> has trouble when "-ansi
    -pedantic" is used! The code is this:-

    #if defined __USE_ISOC9X && defined __GNUC__ && __GNUC__ >= 2

    [snip other defines]

    /* Test for negative number. Used in the signbit() macro. */
    __MATH_INLINE int
    __signbitf (float __x)
    {
      union { float __f; int __i; } __u = { __f: __x }; return __u.__i < 0;
    }
    __MATH_INLINE int
    __signbit (double __x)
    {
      union { double __d; int __i[2]; } __u = { __d: __x }; return
    __u.__i[1] < 0;
    }
    __MATH_INLINE int
    __signbitl (long double __x)
    {
      union { long double __l; int __i[3]; } __u = { __l: __x };
      return (__u.__i[2] & 0x8000) != 0;
    }
    #endif

    <math.h> is also used in coolscan.c, dc25.c, hp-option.c, microtek.c,
    microtek2.c, mustek_pp.c, qcam.c, sharp.c, snapscan.c, umax.c and
    v4l.c, plus preview.c and xscanimage.c.

    Any ideas, anyone??

    Dave

    -- 
    Dave Hill, Kempston, Bedford UK		  dave@minnie.demon.co.uk
    				davehill at users.sourceforge.net
    Sicth munce ago, I cutn't evun spel enjuneer, and now I are one!
    

    -- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com



    This archive was generated by hypermail 2b29 : Tue Aug 08 2000 - 06:24:28 PDT