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

Table Of Contents
Check if you inadvertently inserted a ';'.
Reference:
4354 One of the operands of the %sq operation is a string literal, strcmp()
is recommended for such comparison
Cause:
If the character pointer is compared with a string literal, then the result is unspecified.
char *ch_ptr = "hello";
if(ch_ptr == "world") { }
Action:
Use of '==' to compare 2 strings is unusual and might be done by mistake - check if you should
be using strcmp() instead.
Reference:
4355 the initializer for %n is greater than %s
Cause:
This warning is issued when a large sized array (greater than 32 MB) is getting initialized in the
program.
enum try_stuff {try_array= 0x08000000};
char try[try_array*4] = {1,2,[try_array*4-1]=10 };
Action:
It is safe to create an array of size less than 32 MB.
Reference:
4356 operand of sizeof is a constant rvalue, this might not be what you
intended
Cause:
This warning is issued for sizeof(x) where x is a constant rvalue.
Example:
#include <stdio.h>
#define CONST 10
int foo()
{
printf("%u\n",(unsigned) sizeof(10)); // Issue warning
printf("%u\n",(unsigned) sizeof(CONST)); // Issue warning
return 0;
}
Action:
Using sizeof() on a constant is unusual, and might be done by mistake - check if this is what you
intended.
Reference:
4357 octal escape sequence "%s" is followed by decimal character '%s2'
Cause:
When a non-octal decimal character follows an octal sequence, you may assume that its part of
the escape sequence.
Example:
int main() {
66 Diagnostics Details