DEBUG: Weird ERRORS


#1

I´ve been developing and debugging loading the application to the module and external messages (via Hyperterminal).

I´m tempting to try Debug mode but I couldn´t make it because I´m stuck with the weird ERROR messages I got. And for me they don´t make any sense.

See the ERROR log below:

--------------------Configuration: Socket_rte - Win32 Debug--------------------
Compiling...
Socket.c
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(222) : warning C4028: formal parameter 2 different from declaration
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(222) : warning C4024: 'ed_SocketTCPStart' : different types for formal and actual parameter 3
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(222) : warning C4028: formal parameter 3 different from declaration
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(222) : warning C4024: 'ed_SocketTCPStart' : different types for formal and actual parameter 4
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(222) : warning C4028: formal parameter 2 different from declaration
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(222) : warning C4024: 'ed_SocketTCPStart' : different types for formal and actual parameter 5
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(240) : error C2275: 'ascii' : illegal use of this type as an expression
        c:\openat\v302\tgtgen\wmheader\wm_types.h(49) : see declaration of 'ascii'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(240) : error C2146: syntax error : missing ';' before identifier 'Buff'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(240) : error C2065: 'Buff' : undeclared identifier
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(240) : error C2109: subscript requires array or pointer type
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(241) : error C2275: 'u16' : illegal use of this type as an expression
        c:\openat\v302\tgtgen\wmheader\wm_types.h(50) : see declaration of 'u16'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(241) : error C2146: syntax error : missing ';' before identifier 'i'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(241) : error C2065: 'len' : undeclared identifier
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(285) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(285) : warning C4024: 'sprintf' : different types for formal and actual parameter 1
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(286) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(286) : warning C4024: 'adl_atSendResponse' : different types for formal and actual parameter 2
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(405) : warning C4028: formal parameter 2 different from declaration
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(405) : warning C4024: 'ed_SocketTCPStart' : different types for formal and actual parameter 3
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(405) : warning C4028: formal parameter 3 different from declaration
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(405) : warning C4024: 'ed_SocketTCPStart' : different types for formal and actual parameter 4
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(405) : warning C4028: formal parameter 2 different from declaration
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(405) : warning C4024: 'ed_SocketTCPStart' : different types for formal and actual parameter 5
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(442) : error C2275: 'adl_tmr_t' : illegal use of this type as an expression
        c:\openat\v302\tgtgen\adl\headers\adl_timerhandler.h(72) : see declaration of 'adl_tmr_t'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(442) : error C2065: 'tt' : undeclared identifier
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(443) : error C2275: 'u16' : illegal use of this type as an expression
        c:\openat\v302\tgtgen\wmheader\wm_types.h(50) : see declaration of 'u16'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(443) : error C2146: syntax error : missing ';' before identifier 'timeout_period'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(443) : error C2065: 'timeout_period' : undeclared identifier
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(450) : warning C4047: '=' : 'int ' differs in levels of indirection from 'struct adl_tmr_t *'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(499) : warning C4028: formal parameter 2 different from declaration
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(499) : warning C4024: 'ip_Subscribe' : different types for formal and actual parameter 1
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(543) : warning C4028: formal parameter 2 different from declaration
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(543) : warning C4024: 'ed_SocketLTCPStop' : different types for formal and actual parameter 2
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(571) : warning C4090: '=' : different 'const' qualifiers
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(572) : warning C4090: '=' : different 'const' qualifiers
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(573) : warning C4028: formal parameter 1 different from declaration
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(573) : warning C4133: '=' : incompatible types - from 'void (__cdecl *)(void )' to 'unsigned char (__cdecl *)(unsigned char )'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(579) : warning C4305: '=' : truncation from 'const int ' to 'unsigned char '
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(606) : warning C4133: 'function' : incompatible types - from 'void (__cdecl *)(unsigned short ,unsigned int )' to 'char (__cdecl *)(unsigned short ,unsigned int )'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(609) : warning C4090: 'function' : different 'const' qualifiers
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(609) : warning C4024: 'adl_flhSubscribe' : different types for formal and actual parameter 1
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(620) : warning C4028: formal parameter 1 different from declaration
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(620) : warning C4133: 'function' : incompatible types - from 'void (__cdecl *)(unsigned char )' to 'unsigned char (__cdecl *)(int )'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(620) : warning C4024: 'adl_fcmSubscribe' : different types for formal and actual parameter 2
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(620) : warning C4133: 'function' : incompatible types - from 'void (__cdecl *)(unsigned short ,unsigned char *)' to 'unsigned char (__cdecl *)(unsigned short ,unsigned char *)'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(708) : error C2275: 'ascii' : illegal use of this type as an expression
        c:\openat\v302\tgtgen\wmheader\wm_types.h(49) : see declaration of 'ascii'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(708) : error C2146: syntax error : missing ';' before identifier 'temp'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(708) : error C2065: 'temp' : undeclared identifier
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(708) : error C2109: subscript requires array or pointer type
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(709) : error C2275: 'ascii' : illegal use of this type as an expression
        c:\openat\v302\tgtgen\wmheader\wm_types.h(49) : see declaration of 'ascii'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(709) : error C2065: 'local' : undeclared identifier
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(710) : error C2275: 'ascii' : illegal use of this type as an expression
        c:\openat\v302\tgtgen\wmheader\wm_types.h(49) : see declaration of 'ascii'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(710) : error C2146: syntax error : missing ';' before identifier 'latitude'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(710) : error C2065: 'latitude' : undeclared identifier
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(710) : error C2109: subscript requires array or pointer type
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(711) : error C2275: 'ascii' : illegal use of this type as an expression
        c:\openat\v302\tgtgen\wmheader\wm_types.h(49) : see declaration of 'ascii'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(711) : error C2146: syntax error : missing ';' before identifier 'longitude'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(711) : error C2065: 'longitude' : undeclared identifier
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(711) : error C2109: subscript requires array or pointer type
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(712) : error C2275: 'ascii' : illegal use of this type as an expression
        c:\openat\v302\tgtgen\wmheader\wm_types.h(49) : see declaration of 'ascii'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(712) : error C2146: syntax error : missing ';' before identifier 'teste'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(712) : error C2065: 'teste' : undeclared identifier
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(712) : error C2109: subscript requires array or pointer type
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(713) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(713) : warning C4024: 'sprintf' : different types for formal and actual parameter 1
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(716) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(716) : warning C4024: 'strncpy' : different types for formal and actual parameter 1
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(716) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(716) : warning C4024: 'strncpy' : different types for formal and actual parameter 2
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(717) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(717) : warning C4024: 'strcat' : different types for formal and actual parameter 1
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(717) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(717) : warning C4024: 'strcat' : different types for formal and actual parameter 2
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(725) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int '
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(725) : warning C4024: 'sprintf' : different types for formal and actual parameter 1
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(879) : warning C4133: '=' : incompatible types - from 'char *' to 'struct adl_tmr_t *'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(927) : warning C4047: '=' : 'void (__cdecl *)(unsigned char ,unsigned char )' differs in levels of indirection from 'char *'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(933) : warning C4133: '=' : incompatible types - from 'char *' to 'struct adl_tmr_t *'
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(958) : warning C4090: 'function' : different 'const' qualifiers
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(958) : warning C4024: 'adl_flhWrite' : different types for formal and actual parameter 1
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(963) : warning C4090: 'function' : different 'const' qualifiers
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(963) : warning C4024: 'adl_flhErase' : different types for formal and actual parameter 1
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(969) : warning C4090: 'function' : different 'const' qualifiers
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(969) : warning C4024: 'adl_flhExist' : different types for formal and actual parameter 1
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(985) : warning C4090: 'function' : different 'const' qualifiers
C:\Wavecom\Projetos_TEMP\Socket\src\Socket.c(985) : warning C4024: 'adl_flhRead' : different types for formal and actual parameter 1
Error executing cl.exe.

Socket_rte.dll - 30 error(s), 56 warning(s)

Example: suppose we get the first ERROR message: Line 240. It says there´s an illegal use of “ascii”. Here´s the code:

void tcp_pfDataRequest ( u16 MaxLen, u32 id ){

	ascii Buff [50]; //Line 240
	u16 i, len=0;



	wm_sprintf ( Buff, "\r tcp_pfDataRequest: %d - Using: %d\r\n", MaxLen, len);
	adl_atSendResponse(ADL_AT_UNS, Buff);
}

What´s wrong with this code?

Best Regards,

Henrique


#2

Found out what was going on!

I was declaring the variables after a adl_atSendResponse function!

Now everything is fine but the warning messages… :frowning: