in search of NBEclipse upgrade documentation

Topics for the Eclipse Environment
Post Reply
ellisonsoftware
Posts: 22
Joined: Tue Dec 01, 2009 2:12 pm

in search of NBEclipse upgrade documentation

Post by ellisonsoftware »

I have many NBEclipse projects from a previous version that I'd like to use with NBEclipse 2.8.3.

Does anyone have any documentation on how to bring NB projects forward? I was just pointing the NBEclipse IDE at my pre-existing workspace. That has not worked out as there are all sorts of path name changes, there is a new compiler that doesn't like some old switches, and, it appears some of the definitions in nettypes.h require definitions in other NB include files that it hasn't included.

I am seeing errors for inline, bool, IPADDR as follow:

m68k-elf-gcc -O0 -falign-functions=4 -IE:\workspace\ARES\include -IC:\nburn/include -IE: -IC:\DMH\sdk\include -IC:\nburn/gcc-m68k/m68k-unknown-elf/include -IC:\nburn/SB70LC/include -gdwarf-2 -Wall -Wno-write-strings -c -fmessage-length=0 -mcpu=5270 -DSB70LC -DMCF5270 -fstack-check -fdata-sections -ffunction-sections --std=gnu11 -D_DEBUG -oclient\snmp\nvram-access.od ..\client\snmp\nvram-access.c
In file included from C:\nburn/include/system.h:33:0,
from ..\client\snmp\nvram-access.c:13:
C:\nburn/include/nettypes.h:68:4: error: expected specifier-qualifier-list before 'inline'
inline bool IsNull() {return ((phywadr[2]==0) && (phywadr[1]==0) && (phywadr[0]==0)); };
^
C:\nburn/include/nettypes.h:75:8: error: unknown type name 'bool'
inline bool operator==(const MACADR &i, const MACADR &j)
^
C:\nburn/include/nettypes.h:75:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '==' token
inline bool operator==(const MACADR &i, const MACADR &j)
^
C:\nburn/include/nettypes.h:84:8: error: unknown type name 'bool'
inline bool operator!=(const MACADR & i, const MACADR & j)
^
C:\nburn/include/nettypes.h:84:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!=' token
inline bool operator!=(const MACADR & i, const MACADR & j)
^
C:\nburn/include/nettypes.h:108:1: error: expected specifier-qualifier-list before 'private'
private:
^
C:\nburn/include/nettypes.h:193:8: error: unknown type name 'bool'
inline bool operator==(const IPADDR4 i, const IPADDR4 j){ return i.ip_val==j.ip_val; }
^
C:\nburn/include/nettypes.h:193:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '==' token
inline bool operator==(const IPADDR4 i, const IPADDR4 j){ return i.ip_val==j.ip_val; }
^
C:\nburn/include/nettypes.h:194:8: error: unknown type name 'bool'
inline bool operator!=(const IPADDR4 i, const IPADDR4 j){ return i.ip_val!=j.ip_val; }
^
C:\nburn/include/nettypes.h:194:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!=' token
inline bool operator!=(const IPADDR4 i, const IPADDR4 j){ return i.ip_val!=j.ip_val; }
^
C:\nburn/include/nettypes.h:195:8: error: unknown type name 'bool'
inline bool operator >(const IPADDR4 i, const IPADDR4 j){ return i.ip_val>j.ip_val; }
^
C:\nburn/include/nettypes.h:195:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>' token
inline bool operator >(const IPADDR4 i, const IPADDR4 j){ return i.ip_val>j.ip_val; }
^
C:\nburn/include/nettypes.h:196:8: error: unknown type name 'bool'
inline bool operator <(const IPADDR4 i, const IPADDR4 j){ return i.ip_val<j.ip_val; }
^
C:\nburn/include/nettypes.h:196:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
inline bool operator <(const IPADDR4 i, const IPADDR4 j){ return i.ip_val<j.ip_val; }
^
C:\nburn/include/nettypes.h:199:8: error: unknown type name 'bool'
inline bool operator==(const DWORD i, const IPADDR4 j){ return i==j.ip_val; }
^
C:\nburn/include/nettypes.h:199:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '==' token
inline bool operator==(const DWORD i, const IPADDR4 j){ return i==j.ip_val; }
^
C:\nburn/include/nettypes.h:200:8: error: unknown type name 'bool'
inline bool operator!=(const DWORD i, const IPADDR4 j){ return i!=j.ip_val; }
^
C:\nburn/include/nettypes.h:200:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!=' token
inline bool operator!=(const DWORD i, const IPADDR4 j){ return i!=j.ip_val; }
^
C:\nburn/include/nettypes.h:201:8: error: unknown type name 'bool'
inline bool operator >(const DWORD i, const IPADDR4 j){ return i>j.ip_val; }
^
C:\nburn/include/nettypes.h:201:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>' token
inline bool operator >(const DWORD i, const IPADDR4 j){ return i>j.ip_val; }
^
C:\nburn/include/nettypes.h:202:8: error: unknown type name 'bool'
inline bool operator <(const DWORD i, const IPADDR4 j){ return i<j.ip_val; }
^
C:\nburn/include/nettypes.h:202:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
inline bool operator <(const DWORD i, const IPADDR4 j){ return i<j.ip_val; }
^
C:\nburn/include/nettypes.h:205:8: error: unknown type name 'bool'
inline bool operator==(const IPADDR4 i, const DWORD j){ return i.ip_val==j; }
^
C:\nburn/include/nettypes.h:205:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '==' token
inline bool operator==(const IPADDR4 i, const DWORD j){ return i.ip_val==j; }
^
C:\nburn/include/nettypes.h:206:8: error: unknown type name 'bool'
inline bool operator!=(const IPADDR4 i, const DWORD j){ return i.ip_val!=j; }
^
C:\nburn/include/nettypes.h:206:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!=' token
inline bool operator!=(const IPADDR4 i, const DWORD j){ return i.ip_val!=j; }
^
C:\nburn/include/nettypes.h:207:8: error: unknown type name 'bool'
inline bool operator >(const IPADDR4 i, const DWORD j){ return i.ip_val>j; }
^
C:\nburn/include/nettypes.h:207:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>' token
inline bool operator >(const IPADDR4 i, const DWORD j){ return i.ip_val>j; }
^
C:\nburn/include/nettypes.h:208:8: error: unknown type name 'bool'
inline bool operator <(const IPADDR4 i, const DWORD j){ return i.ip_val<j; }
^
C:\nburn/include/nettypes.h:208:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
inline bool operator <(const IPADDR4 i, const DWORD j){ return i.ip_val<j; }
^
C:\nburn/include/nettypes.h:210:8: error: unknown type name 'IPADDR4'
inline IPADDR4 IPV4FromConst(DWORD d) {IPADDR4 i4; i4.ip_val=d; return i4; };
^
C:\nburn/include/nettypes.h: In function 'IPV4FromConst':
C:\nburn/include/nettypes.h:210:40: error: unknown type name 'IPADDR4'
inline IPADDR4 IPV4FromConst(DWORD d) {IPADDR4 i4; i4.ip_val=d; return i4; };
^
C:\nburn/include/nettypes.h:210:54: error: request for member 'ip_val' in something not a structure or union
inline IPADDR4 IPV4FromConst(DWORD d) {IPADDR4 i4; i4.ip_val=d; return i4; };
^
C:\nburn/include/nettypes.h: At top level:
C:\nburn/include/nettypes.h:213:8: error: unknown type name 'IPADDR4'
inline IPADDR4 LocalBroadCast(IPADDR4 ifip,IPADDR4 ipmask) {return IPV4FromConst(ifip.ip_val|~(ipmask.ip_val)); };
^
C:\nburn/include/nettypes.h:213:31: error: unknown type name 'IPADDR4'
inline IPADDR4 LocalBroadCast(IPADDR4 ifip,IPADDR4 ipmask) {return IPV4FromConst(ifip.ip_val|~(ipmask.ip_val)); };
^
C:\nburn/include/nettypes.h:213:44: error: unknown type name 'IPADDR4'
inline IPADDR4 LocalBroadCast(IPADDR4 ifip,IPADDR4 ipmask) {return IPV4FromConst(ifip.ip_val|~(ipmask.ip_val)); };
^
C:\nburn/include/nettypes.h:254:9: error: unknown type name 'IPADDR4'
typedef IPADDR4 IPADDR;
^
In file included from ..\client\snmp\nvram-access.c:13:0:
C:\nburn/include/system.h:114:5: error: unknown type name 'IPADDR4'
IPADDR4 ip_Addr; /* The device IP address */
^
C:\nburn/include/system.h:115:5: error: unknown type name 'IPADDR4'
IPADDR4 ip_Mask; /* The IP Address Mask */
^
C:\nburn/include/system.h:116:5: error: unknown type name 'IPADDR4'
IPADDR4 ip_GateWay; /* The IP address of the gateway */
^
C:\nburn/include/system.h:117:5: error: unknown type name 'IPADDR4'
IPADDR4 ip_TftpServer; /* The address of the TFTP server to load data from for debugging */
^
C:\nburn/include/system.h:127:5: error: unknown type name 'IPADDR4'
IPADDR4 ip_DNS_server; /* The DNS server address */
^
ellisonsoftware
Posts: 22
Joined: Tue Dec 01, 2009 2:12 pm

Re: in search of NBEclipse upgrade documentation

Post by ellisonsoftware »

do these build issues occur because the nettypes.h declares in C++ format while being included into a C source file?

If so, how does one represent an IPADDR4 from C code?
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: in search of NBEclipse upgrade documentation

Post by TomNB »

Hi Mark,

If you are going to use the 2.8.x branch or later, there are 2 things that must happen:

1. All files must have a .cpp extension. I can see in your output there are .c files

2. In order to provide the best compatibility with the existing customer code base, the IPADDR type has changed from a 32-bit unsigned long to an object that can hold an IPv4 or IPv6 address. It will require a change to any code you have that treats IPADDR as a unsigned long, but it avoids having a much bigger problem of multiple types for v4 and v6 addresses. This is described in detail in \nburn\docs\ipv6\IPv6DualStackMode.pdf.

You then access the object with member functions. For example:

if ( EthernetIP == 0 )

would change to

if ( EthernetIP.IsNull() )


I see from your output you are using software from DMH. They have had their s/w working with 2.8.x in 2015, so you could probably get an update from them.
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: in search of NBEclipse upgrade documentation

Post by TomNB »

Other reasons to update to 2.8.x:

The GCC compiler has been updated to 5.2. You will likely get some warnings when you build with it because it is much more strict on coding standards and error checking

Stack checking is built-in

Code stripping is enabled to strip out unused functions. In our tests code size has been reduced 15% to 25%.
Post Reply