gdb
[Top][All Lists]
Advanced

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

minor warnings/error compiling gdb 7.1 with Sun cc


From: Jay K
Subject: minor warnings/error compiling gdb 7.1 with Sun cc
Date: Mon, 12 Jul 2010 10:53:04 +0000

libtool: compile:  cc -DHAVE_CONFIG_H -I. -I/home/jay/src/gdb-7.1/bfd -I. 
-I/home/jay/src/gdb-7.1/bfd -I/home/jay/src/gdb-7.1/bfd/../include 
-DBINDIR=\"/home/jay/bin\" -g -c /home/jay/src/gdb-7.1/bfd/libbfd.c -o libbfd.o
"/home/jay/src/gdb-7.1/bfd/libbfd.c", line 708: warning: integer overflow 
detected: op "<<"
"/home/jay/src/gdb-7.1/bfd/libbfd.c", line 708: warning: integer overflow 
detected: op "<<"
"/home/jay/src/gdb-7.1/bfd/libbfd.c", line 731: warning: integer overflow 
detected: op "<<"
"/home/jay/src/gdb-7.1/bfd/libbfd.c", line 731: warning: integer overflow 
detected: op "<<"

probably from:
#define EIGHT_GAZILLION ((bfd_int64_t) 1 << 63)


bash-3.00$ cc -c 1.c
"1.c", line 1: warning: integer overflow detected: op "<<"
-bash-3.00$ cat 1.c
long long a = (long long) 1 << 63;


Looks like win via:
long long a = (long long)(((unsigned long long)1) << 63);


more severe:

"/home/jay/src/gdb-7.1/bfd/elfxx-sparc.c", line 2944: undefined symbol: 
__FUNCTION__
cc: acomp failed for /home/jay/src/gdb-7.1/bfd/elfxx-sparc.c

-bash-3.00$ uname -a
SunOS ssol 5.10 Generic_139555-08 sun4u sparc SUNW,Sun-Blade-100
-bash-3.00$ cc -V
cc: Sun C 5.9 SunOS_sparc Patch 124867-01 2007/07/12
usage: cc [ options] files.  Use 'cc -flags' for details


It's not in a macro, so I replaced it with "_bfd_sparc_elf_relocate_section"
though you could go and replace the %s with that (and in the __FUNCTION__
case, you could rely on the compiler doing string concat)


Yes, I understand, __FUNCTION__ is a C9xism, probably available via CFLAGS or 
gcc.

There are other warnings but I'll probably not go through them:

/home/jay/src/gdb-7.1/gdb/coff-pe-read.c", line 317: warning: assignment type 
mismatch:
        pointer to char "=" pointer to unsigned char
"/home/jay/src/gdb-7.1/gdb/coff-pe-read.c", line 353: warning: argument #1 is 
incompatible with prototype:
        prototype: pointer to char : 
"/home/jay/src/gdb-7.1/gdb/coff-pe-read.c", line 100
        argument : pointer to unsigned char
source='/home/jay/src/gdb-7.1/gdb/dwarf2read.c' object='dwarf2read.o' 
libtool=no DEPDIR=.deps depmode=dashXmstdout /bin/bash 
/home/jay/src/gdb-7.1/gdb/../depcomp cc -g   -I. -I/home/jay/src/gdb-7.1/gdb 
-I/home/jay/src/gdb-7.1/gdb/common -I/home/jay/src/gdb-7.1/gdb/config 
-DLOCALEDIR="\"/home/jay/share/locale\"" -DHAVE_CONFIG_H 
-I/home/jay/src/gdb-7.1/gdb/../include/opcode 
-I/home/jay/src/gdb-7.1/gdb/../readline/.. -I../bfd 
-I/home/jay/src/gdb-7.1/gdb/../bfd -I/home/jay/src/gdb-7.1/gdb/../include 
-I../libdecnumber -I/home/jay/src/gdb-7.1/gdb/../libdecnumber  
-I/home/jay/src/gdb-7.1/gdb/gnulib -Ignulib  -DMI_OUT=1 -DTUI=1     -c -o 
dwarf2read.o /home/jay/src/gdb-7.1/gdb/dwarf2read.c
"/home/jay/src/gdb-7.1/gdb/dwarf2read.c", line 1303: warning: argument #1 is 
incompatible with prototype:
        prototype: pointer to const char : "/usr/include/iso/string_iso.h", 
line 71
        argument : pointer to unsigned char
"/home/jay/src/gdb-7.1/gdb/dwarf2read.c", line 1375: warning: argument #1 is 
incompatible with prototype:
        prototype: pointer to const char : "/usr/include/iso/string_iso.h", 
line 71
        argument : pointer to unsigned char
"/home/jay/src/gdb-7.1/gdb/dwarf2read.c", line 1401: warning: assignment type 
mismatch:
        pointer to unsigned char "=" pointer to char
"/home/jay/src/gdb-7.1/gdb/dwarf2read.c", line 6947: warning: assignment type 
mismatch:
        pointer to char "=" pointer to unsigned char
"/home/jay/src/gdb-7.1/gdb/dwarf2read.c", line 6948: warning: argument #1 is 
incompatible with prototype:
        prototype: pointer to unsigned char : 
"/home/jay/src/gdb-7.1/gdb/dwarf2read.c", line 2812
        argument : pointer to char
"/home/jay/src/gdb-7.1/gdb/dwarf2read.c", line 6952: warning: argument #6 is 
incompatible with prototype:
        prototype: pointer to unsigned char : 
"/home/jay/src/gdb-7.1/gdb/dwarf2read.c", line 6736
        argument : pointer to char
"/home/jay/src/gdb-7.1/gdb/dwarf2read.c", line 6952: warning: assignment type 
mismatch:
        pointer to char "=" pointer to unsigned char
"/home/jay/src/gdb-7.1/gdb/dwarf2read.c", line 6956: warning: argument #3 is 
incompatible with prototype:
        prototype: pointer to unsigned char : 
"/home/jay/src/gdb-7.1/gdb/dwarf2read.c", line 6514
        argument : pointer to char
source='/home/jay/src/gdb-7.1/gdb/mipsread.c' object='mipsread.o' libtool=no 
DEPDIR

 - Jay

                                          


reply via email to

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