I have just moved to inet-1.99.4-development-03d5d15-src.tgz
I am running on Ubuntu i686:
2.6.35-32-generic #67-Ubuntu SMP Mon Mar 5 19:35:26 UTC 2012 i686 GNU/Linux
I get the warnings:
linklayer/contract/MACAddress.h:59: warning: integer constant is too large for ‘unsigned long’ type
linklayer/contract/MACAddress.h:119: warning: integer constant is too large for ‘unsigned long’ type
linklayer/contract/MACAddress.h:124: warning: integer constant is too large for ‘unsigned long’ type
It is clearly caused by the fact long int on my machine is 32bit...
AFAIK there is no "standard" way to write portable code that will know if the long int is 64bit or 32bit.
So I am not sure what to propose here.
I think a best fix should go into OMNET configure script itself (could be coded as a simple test
program that checks the sizeof(long int)). That would probably add -DIS64BIT or similar.
Meanwhile (for linux) we can simply add the following code to linklayer/contract/MACAddress.h:
#if defined(_WORDSIZE) && __WORDSIZE == 64
# define MAC_ADDRESS_MASK 0x0000ffffffffffffUL
#else
# define MAC_ADDRESS_MASK 0x0000ffffffffffffULL
#endif
So I opened file /src/linklayer/contract/MACAddress.h
In the head there is this line:
#define MAC_ADDRESS_MASK 0xffffffffffffL
I changed it to:
#if defined(_WORDSIZE) && __WORDSIZE == 64
# define MAC_ADDRESS_MASK 0x0000ffffffffffffUL
#else
# define MAC_ADDRESS_MASK 0x0000ffffffffffffULL
#endif
Run make command again, I got one similar error:
linklayer/contract/MACAddress.cc line 137: error: integer constant is too large for ‘long’ type
In file /src/linklayer/contract/MACAddress.cc line 137,
uint64 intAddr = 0x0AAA00000000L + (autoAddressCtr & 0xffffffffL);
I changed it to:
uint64 intAddr = 0x0AAA00000000ULL + (autoAddressCtr & 0xffffffffULL);
Run make again, and compile inet-2.1.0 successfully.