[Devel] [ openser-Bugs-1388186 ] Compile failure on AMD64

SourceForge.net noreply at sourceforge.net
Thu Dec 22 19:35:04 CET 2005


Bugs item #1388186, was opened at 2005-12-22 16:45
Message generated for change (Comment added) made by goestelecom
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1388186&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: ver devel
>Status: Open
Resolution: Fixed
Priority: 5
Submitted By: Norman Brandinger (goestelecom)
Assigned to: Bogdan (bogdan_iancu)
Summary: Compile failure on AMD64

Initial Comment:
This problem appears related to the following thread,
at least that is where soem compiler warnings were
first noticed.

http://openser.org/pipermail/devel/2005-November/001122.html

On an AMD64 based machine, the following compile
failure happens:

Compiling items.c
gcc -g -O9 -funroll-loops  -Wcast-align  -Wall 
-minline-all-stringops -falign-loops   -Werror   
-DNAME='"openser"' -DVERSION='"1.1.0-dev4 "'
-DARCH='"x86_64"' -DOS='"freebsd"' -DCOMPILER='"gcc
3.4"' -D__CPU_x86_64 -D__OS_freebsd
-DCFG_DIR='"/usr/local/etc/openser/"' -DPKG_MALLOC
-DSHM_MEM  -DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6
-DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES
-DF_MALLOC  -DFAST_LOCK -DADAPTIVE_WAIT
-DADAPTIVE_WAIT_LOOPS=1024  -DHAVE_SOCKADDR_SA_LEN
-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN
-DHAVE_SCHED_YIELD -DHAVE_MSGHDR_MSG_CONTROL
-DHAVE_CONNECT_ECONNRESET_BUG -c items.c -o items.o
items.c: In function `xl_get_content_length':
items.c:908: warning: cast from pointer to integer of
different size
gmake: *** [items.o] Error 1


The simple test program below was run on both Intel and
AMD processors

#include <stdio.h>
main() {
  char *ptr;
  printf("Size of int: %d\n", sizeof(int));
  printf("Size of char: %d\n", sizeof(char));
  printf("Size of char*: %d\n", sizeof(ptr));
  printf("Size of long: %d\n", sizeof(long));
  printf("Size of void*: %d\n", sizeof(void*));
  return;
}

AMD64 Results:

Size of int: 4
Size of char: 1
Size of char*: 8
Size of long: 8
Size of void*: 8

Intel Results:

Size of int: 4
Size of char: 1
Size of char*: 4
Size of long: 4
Size of void*: 4

It looks like the difference between the 4 byte int
size and the 8 byte pointer sizes on the AMD based
machines is causing the problem.

Regards,
Norm

p.s. I believe that a couple of other modules (other
than items.c) are effected by this.

----------------------------------------------------------------------

>Comment By: Norman Brandinger (goestelecom)
Date: 2005-12-22 18:35

Message:
Logged In: YES 
user_id=1372252

gmake[1]: Entering directory
`/usr/local/src/sip-server/modules/unixodbc'
Compiling dbase.c
gcc -fPIC -DPIC -g -O9 -funroll-loops  -Wcast-align  -Wall 
-minline-all-stringops -falign-loops   -Werror   
-DNAME='"openser"' -DVERSION='"1.1.0-dev4 "'
-DARCH='"x86_64"' -DOS='"freebsd"' -DCOMPILER='"gcc 3.4"'
-D__CPU_x86_64 -D__OS_freebsd
-DCFG_DIR='"/usr/local/etc/openser/"' -DPKG_MALLOC -DSHM_MEM
 -DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP
-DDISABLE_NAGLE -DHAVE_RESOLV_RES -DF_MALLOC  -DFAST_LOCK
-DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 
-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2
-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD
-DHAVE_MSGHDR_MSG_CONTROL -DHAVE_CONNECT_ECONNRESET_BUG
-I/usr/local/include -c dbase.c -o dbase.o
dbase.c: In function `submit_query':
dbase.c:60: warning: cast from pointer to integer of
different size
dbase.c:60: warning: cast from pointer to integer of
different size
dbase.c:60: warning: cast from pointer to integer of
different size
dbase.c:60: warning: cast from pointer to integer of
different size
dbase.c:60: warning: cast from pointer to integer of
different size
dbase.c:60: warning: cast from pointer to integer of
different size
dbase.c:60: warning: cast from pointer to integer of
different size
dbase.c:60: warning: cast from pointer to integer of
different size
dbase.c:68: warning: cast from pointer to integer of
different size
dbase.c:68: warning: cast from pointer to integer of
different size
dbase.c:68: warning: cast from pointer to integer of
different size
dbase.c:68: warning: cast from pointer to integer of
different size
dbase.c:68: warning: cast from pointer to integer of
different size
dbase.c:68: warning: cast from pointer to integer of
different size
dbase.c:68: warning: cast from pointer to integer of
different size
dbase.c:68: warning: cast from pointer to integer of
different size
gmake[1]: *** [dbase.o] Error 1
gmake[1]: Leaving directory
`/usr/local/src/sip-server/modules/unixodbc'


gmake[1]: Entering directory
`/usr/local/src/sip-server/modules/auth_db'
Compiling authdb_mod.c
gcc -fPIC -DPIC -g -O9 -funroll-loops  -Wcast-align  -Wall 
-minline-all-stringops -falign-loops   -Werror   
-DNAME='"openser"' -DVERSION='"1.1.0-dev4 "'
-DARCH='"x86_64"' -DOS='"freebsd"' -DCOMPILER='"gcc 3.4"'
-D__CPU_x86_64 -D__OS_freebsd
-DCFG_DIR='"/usr/local/etc/openser/"' -DPKG_MALLOC -DSHM_MEM
 -DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP
-DDISABLE_NAGLE -DHAVE_RESOLV_RES -DF_MALLOC  -DFAST_LOCK
-DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 
-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2
-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD
-DHAVE_MSGHDR_MSG_CONTROL -DHAVE_CONNECT_ECONNRESET_BUG -c
authdb_mod.c -o authdb_mod.o
In file included from authdb_mod.c:44:
../auth/aaa_avps.h: In function `parse_aaa_avps':
../auth/aaa_avps.h:162: warning: int format, different type
arg (arg 4)
../auth/aaa_avps.h:162: warning: int format, different type
arg (arg 4)
../auth/aaa_avps.h:162: warning: int format, different type
arg (arg 4)
../auth/aaa_avps.h:162: warning: int format, different type
arg (arg 4)
../auth/aaa_avps.h:162: warning: int format, different type
arg (arg 4)
../auth/aaa_avps.h:162: warning: int format, different type
arg (arg 4)
../auth/aaa_avps.h:162: warning: int format, different type
arg (arg 4)
gmake[1]: *** [authdb_mod.o] Error 1
gmake[1]: Leaving directory
`/usr/local/src/sip-server/modules/auth_db'






----------------------------------------------------------------------

Comment By: Bogdan (bogdan_iancu)
Date: 2005-12-22 18:29

Message:
Logged In: YES 
user_id=1275325

ok - I fixed them also...are there ant more? ;)

thank,
bogdan

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-12-22 17:45

Message:
Logged In: NO 

gmake[1]: Entering directory
`/usr/local/src/sip-server/modules/tm'
Compiling t_fifo.c
gcc -fPIC -DPIC -g -O9 -funroll-loops  -Wcast-align  -Wall 
-minline-all-stringops -falign-loops   -Werror   
-DNAME='"openser"' -DVERSION='"1.1.0-dev4 "'
-DARCH='"x86_64"' -DOS='"freebsd"' -DCOMPILER='"gcc 3.4"'
-D__CPU_x86_64 -D__OS_freebsd
-DCFG_DIR='"/usr/local/etc/openser/"' -DPKG_MALLOC -DSHM_MEM
 -DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP
-DDISABLE_NAGLE -DHAVE_RESOLV_RES -DF_MALLOC  -DFAST_LOCK
-DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 
-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2
-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD
-DHAVE_MSGHDR_MSG_CONTROL -DHAVE_CONNECT_ECONNRESET_BUG -c
t_fifo.c -o t_fifo.o
t_fifo.c: In function `parse_tw_append':
t_fifo.c:252: warning: field precision is not type int (arg 3)
t_fifo.c:252: warning: field precision is not type int (arg 3)
t_fifo.c:252: warning: field precision is not type int (arg 3)
t_fifo.c:252: warning: field precision is not type int (arg 3)
t_fifo.c:252: warning: field precision is not type int (arg 3)
t_fifo.c:252: warning: field precision is not type int (arg 3)
t_fifo.c:252: warning: field precision is not type int (arg 3)
gmake[1]: *** [t_fifo.o] Error 1
gmake[1]: Leaving directory
`/usr/local/src/sip-server/modules/tm'






gmake[1]: Entering directory
`/usr/local/src/sip-server/modules/uac_redirect'
Compiling redirect.c
gcc -fPIC -DPIC -g -O9 -funroll-loops  -Wcast-align  -Wall 
-minline-all-stringops -falign-loops   -Werror   
-DNAME='"openser"' -DVERSION='"1.1.0-dev4 "'
-DARCH='"x86_64"' -DOS='"freebsd"' -DCOMPILER='"gcc 3.4"'
-D__CPU_x86_64 -D__OS_freebsd
-DCFG_DIR='"/usr/local/etc/openser/"' -DPKG_MALLOC -DSHM_MEM
 -DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP
-DDISABLE_NAGLE -DHAVE_RESOLV_RES -DF_MALLOC  -DFAST_LOCK
-DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 
-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2
-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD
-DHAVE_MSGHDR_MSG_CONTROL -DHAVE_CONNECT_ECONNRESET_BUG -c
redirect.c -o redirect.o
redirect.c: In function `get_redirect_fixup':
redirect.c:157: warning: cast to pointer from integer of
different size
gmake[1]: *** [redirect.o] Error 1
gmake[1]: Leaving directory
`/usr/local/src/sip-server/modules/uac_redirect'



----------------------------------------------------------------------

Comment By: Norman Brandinger (goestelecom)
Date: 2005-12-22 17:22

Message:
Logged In: YES 
user_id=1372252

Changed (int) to (long) on line 908 of item.c -- your
suggestion fixed the problem.

Below is the next error:

gmake[1]: Entering directory
`/usr/local/src/sip-server/modules/acc'
Compiling acc_extra.c
gcc -fPIC -DPIC -g -O9 -funroll-loops  -Wcast-align  -Wall 
-minline-all-stringops -falign-loops   -Werror   
-DNAME='"openser"' -DVERSION='"1.1.0-dev4 "'
-DARCH='"x86_64"' -DOS='"freebsd"' -DCOMPILER='"gcc 3.4"'
-D__CPU_x86_64 -D__OS_freebsd
-DCFG_DIR='"/usr/local/etc/openser/"' -DPKG_MALLOC -DSHM_MEM
 -DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP
-DDISABLE_NAGLE -DHAVE_RESOLV_RES -DF_MALLOC  -DFAST_LOCK
-DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 
-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2
-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD
-DHAVE_MSGHDR_MSG_CONTROL -DHAVE_CONNECT_ECONNRESET_BUG
-DSQL_ACC -c acc_extra.c -o acc_extra.o
acc_extra.c: In function `parse_acc_extra':
acc_extra.c:165: warning: int format, different type arg (arg 4)
acc_extra.c:165: warning: int format, different type arg (arg 4)
acc_extra.c:165: warning: int format, different type arg (arg 4)
acc_extra.c:165: warning: int format, different type arg (arg 4)
acc_extra.c:165: warning: int format, different type arg (arg 4)
acc_extra.c:165: warning: int format, different type arg (arg 4)
acc_extra.c:165: warning: int format, different type arg (arg 4)
gmake[1]: *** [acc_extra.o] Error 1
gmake[1]: Leaving directory
`/usr/local/src/sip-server/modules/acc'


----------------------------------------------------------------------

Comment By: Bogdan (bogdan_iancu)
Date: 2005-12-22 17:07

Message:
Logged In: YES 
user_id=1275325

It's just a warning about improper cast - the parsed pointer
of Content-Length header stores an integer (the length); see
parser/msg_parser.c +171;
When fetching the value, a cast via (long) in required on
64bits machines.

If you found ant other warnings related to this issue,
please report them in order to be fixed.

Thanks

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1388186&group_id=139143



More information about the Devel mailing list