Operating System - HP-UX
1833770 Members
2084 Online
110063 Solutions
New Discussion

Re: aCC error with unsigned int

 
SOLVED
Go to solution
Ian Kitcher
Occasional Contributor

aCC error with unsigned int

I cannot compile code used by Agilent ADS which has previously been compiled successfully on a PC. I'm hoping someone will recognise this type of error and let me know how to cure it.
Error message is:

aCC -z +Z +DAportable +DS871 +w -g0 +d -I/apps_hp/agilent/ads_2001/hptolemy/src/
gsl -I/apps_hp/agilent/ads_2001/hptolemy/src/hptolemy-kernel/kernel -I/apps_hp/a
gilent/ads_2001/hptolemy/src/hptolemy-kernel/compat/ptolemy -I/apps_hp/agilent/a
ds_2001/hptolemy/src/hptolemy-kernel/compat/cfront -I/apps_hp/agilent/ads_2001/h
ptolemy/src/hptolemy-kernel/compat/unix -I../src +W740,749 -D_HPUX_SOURCE -DSY
SV -DHPUX_10 -I/apps_hp/agilent/ads_2001/hptolemy/src/timed/kernel -I/apps_hp/
agilent/ads_2001/hptolemy/src/numeric/kernel -c -o Universal_Chip.o ../src/Univ
ersal_Chip.cc
Warning (suggestion) 469: "/usr/include/stdlib.h", line 40 # This typedef
keyword is useless because it does not declare any new type names.
typedef unsigned int wchar_t;
^^^^^^^
Error 19: "../src/Universal_Chip.cc", line 48 # Unexpected 'int'.
int_value = unsigned int(strtol(a_temp, &p, 0));
1 REPLY 1
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: aCC error with unsigned int

Hi Ian,

I don't care if this compiled on your PC; this is bad syntax. The warning can be ingored but you a missing a type cast.

int_value = unsigned int(strtol(a_temp, &p, 0));
should be
int_value = (unsigned int)(strtol(a_temp, &p, 0));
If it ain't broke, I can fix that.