This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [BUILDROBOT] Still warns on integer overflow in expression


On Fri, 2016-02-05 13:38:57 +0000, Nick Clifton <nickc@redhat.com> wrote:
> > Even with this cast in place, gcc111 still warns on this:
> > 
> > /home/jbglaw/repos/binutils_gdb/gas/config/tc-microblaze.c: In function 'parse_imm':
> > /home/jbglaw/repos/binutils_gdb/gas/config/tc-microblaze.c:742:21: error: integer overflow in expression [-Werror=overflow]
> >    e->X_add_number |= -((offsetT) 1 << 31);
> 
> I think that this was fixed by:
> 
> commit ac0d427f4b3a2b82dcf395da74fdbc71ee598095
> Author: Nick Clifton <nickc@redhat.com>
> Date:   Mon Feb 1 11:36:59 2016 +0000
> 
>     Fix error building Microblaze assembler on a 32-bit host.
>     
>         * config/tc-microblaze.c (parse_imm): Fix compile time warning
>         message extending a negative 32-bit value into a larger signed
>         value on a 32-bit host.
> 
> Can you confirm ?

A more recent build
(http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=489240
which started at 2016-02-04 20:25:21 UTC) was *successful* for Binutils,
though building gdb failed in sim (which isn't neccessarily a new
issue):

$ .../configure --prefix=/home/jbglaw/build/microblaze-linux/_install_ --target=microblaze-linux
$ make all-gdb
[...]
gcc -DHAVE_CONFIG_H  -DWITH_DEFAULT_ALIGNMENT=STRICT_ALIGNMENT     -DDEFAULT_INLINE=0   -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral      -I. -I/home/jbglaw/repos/binutils_gdb/sim/microblaze -I../common -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../common -I../../include -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../include -I../../bfd -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../bfd -I../../opcodes -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../opcodes  -g -O2 -c -o callback.o -MT callback.o -MMD -MP -MF .deps/callback.Tpo /home/jbglaw/repos/binutils_gdb/sim/microblaze/../common/callback.c
/home/jbglaw/repos/binutils_gdb/sim/microblaze/../common/callback.c: In function 'os_time':
/home/jbglaw/repos/binutils_gdb/sim/microblaze/../common/callback.c:427:3: warning: passing argument 1 of 'time' from incompatible pointer type [enabled by default]
   return wrap (p, time (t));
   ^
In file included from /home/jbglaw/repos/binutils_gdb/sim/microblaze/../common/callback.c:45:0:
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.8.1/include-fixed/time.h:161:20: note: expected 'time_t *' but argument is of type 'long int *'
     extern time_t  time(time_t *);
                    ^
gcc -DHAVE_CONFIG_H  -DWITH_DEFAULT_ALIGNMENT=STRICT_ALIGNMENT     -DDEFAULT_INLINE=0   -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral      -I. -I/home/jbglaw/repos/binutils_gdb/sim/microblaze -I../common -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../common -I../../include -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../include -I../../bfd -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../bfd -I../../opcodes -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../opcodes  -g -O2 -c -o syscall.o -MT syscall.o -MMD -MP -MF .deps/syscall.Tpo /home/jbglaw/repos/binutils_gdb/sim/microblaze/../common/syscall.c
/home/jbglaw/repos/binutils_gdb/sim/microblaze/../common/syscall.c: In function 'cb_syscall':
/home/jbglaw/repos/binutils_gdb/sim/microblaze/../common/syscall.c:593:2: warning: passing argument 2 of 'cb->time' from incompatible pointer type [enabled by default]
  time_t t = (*cb->time) (cb, (time_t *) 0);
  ^
/home/jbglaw/repos/binutils_gdb/sim/microblaze/../common/syscall.c:593:2: note: expected 'long int *' but argument is of type 'time_t *'
gcc -DHAVE_CONFIG_H  -DWITH_DEFAULT_ALIGNMENT=STRICT_ALIGNMENT     -DDEFAULT_INLINE=0   -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral      -I. -I/home/jbglaw/repos/binutils_gdb/sim/microblaze -I../common -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../common -I../../include -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../include -I../../bfd -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../bfd -I../../opcodes -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../opcodes  -g -O2 -c -o targ-map.o -MT targ-map.o -MMD -MP -MF .deps/targ-map.Tpo targ-map.c
gcc -DHAVE_CONFIG_H  -DWITH_DEFAULT_ALIGNMENT=STRICT_ALIGNMENT     -DDEFAULT_INLINE=0   -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral      -I. -I/home/jbglaw/repos/binutils_gdb/sim/microblaze -I../common -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../common -I../../include -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../include -I../../bfd -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../bfd -I../../opcodes -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../opcodes  -g -O2 -c -o version.o -MT version.o -MMD -MP -MF .deps/version.Tpo version.c
gcc -DHAVE_CONFIG_H  -DWITH_DEFAULT_ALIGNMENT=STRICT_ALIGNMENT     -DDEFAULT_INLINE=0   -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral      -I. -I/home/jbglaw/repos/binutils_gdb/sim/microblaze -I../common -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../common -I../../include -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../include -I../../bfd -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../bfd -I../../opcodes -I/home/jbglaw/repos/binutils_gdb/sim/microblaze/../../opcodes  -g -O2 -c -o interp.o -MT interp.o -MMD -MP -MF .deps/interp.Tpo /home/jbglaw/repos/binutils_gdb/sim/microblaze/interp.c
/home/jbglaw/repos/binutils_gdb/sim/microblaze/interp.c: In function 'microblaze_extract_unsigned_integer':
/home/jbglaw/repos/binutils_gdb/sim/microblaze/interp.c:34:57: error: 'BIG_ENDIAN' undeclared (first use in this function)
 #define target_big_endian (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN)
                                                         ^
/home/jbglaw/repos/binutils_gdb/sim/microblaze/interp.c:52:8: note: in expansion of macro 'target_big_endian'
   if (!target_big_endian)
        ^
/home/jbglaw/repos/binutils_gdb/sim/microblaze/interp.c:34:57: note: each undeclared identifier is reported only once for each function it appears in
 #define target_big_endian (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN)
                                                         ^
/home/jbglaw/repos/binutils_gdb/sim/microblaze/interp.c:52:8: note: in expansion of macro 'target_big_endian'
   if (!target_big_endian)
        ^
/home/jbglaw/repos/binutils_gdb/sim/microblaze/interp.c: In function 'microblaze_store_unsigned_integer':
/home/jbglaw/repos/binutils_gdb/sim/microblaze/interp.c:34:57: error: 'BIG_ENDIAN' undeclared (first use in this function)
 #define target_big_endian (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN)
                                                         ^
/home/jbglaw/repos/binutils_gdb/sim/microblaze/interp.c:74:8: note: in expansion of macro 'target_big_endian'
   if (!target_big_endian)
        ^
make[2]: *** [interp.o] Error 1
make[2]: Leaving directory `/home/jbglaw/build/microblaze-linux/build-gdb/sim/microblaze'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/jbglaw/build/microblaze-linux/build-gdb/sim'
make: *** [all-sim] Error 2

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
Signature of:         "really soon now":      an unspecified period of time, likly to
the second  :                                 be greater than any reasonable definition
                                              of "soon".

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]