HP-UX Cadvise Diagnostics Reference Guide (5900-1865, August 2012)

Table Of Contents
4378 endian porting: accessing data without conversion may be endian
dependent
Cause:
After receiving data from the remote socket to host system, it should be converted from network to
host byte order to ensure correctness of the data.
This diagnostic occurs when the data,
1. received from network/other system is not converted using pre-defined conversion calls such
as ntohs/ntohl or
2. modified before usage but after the conversion.
Example:
int main()
{
int sock, data;
recv(sock, data);
data++;
return 0;
}
Following is the cadvise warning for above scenario of recv but no conversion before usage of data:
"/user/rajen/cadvise/testing/endian/Data_Transfer/e1.c", line 19: warning #4378-D: endian porting: accessing
data without conversion may be endian dependent
data++;
Action:
Convert data to host byte order after receiving from network.
4379 <Function Name>:<Function Start Line Number>:<Function End Line
Number>
Cause:
This is just an information message, generated by default for each function with function name and
location information.
Example:
1. int main()
2. {
3. int a;
4. return a;
5. }
Following is cadvise info message generated for above scenario:
"funcInfo.c", line 2: info #4379-D:
main:2:5
{
^
;
20035 variable %s is used before its value is set
Cause:
The compiler has detected use of a variable's value before it is set.
Example:
int func(int b)
{
int a;
a = a + b; // warning 20035 for use of variable a
return a;
}
4378 endian porting: accessing data without conversion may be endian dependent 71