Code generator warning and error messages – Zilog ZUSBOPTS User Manual
Page 236

Warning and Error Messages
UM017105-0511
208
Zilog Developer Studio II – ZNEO™
User Manual
•
Recode to pass a string literal. For example, the code in the example can be revised as
follows:
define MSG1 "x = %4d"
char buff[sizeof(MSG1)+4];
sprintf(buff,MSG1,x); // OK
•
Keep the
Generate Printfs Inline
checkbox selected and ignore the warning. This
loses the primary goal of the option but results in the faster execution of the calls to
printf or sprintf that can be processed at compile time, a secondary goal of the option.
252 Bad format string passed to (s)printf.
This warning occurs when the compiler is
unable to parse the string literal format and the inline generation of printf calls is
requested. A normal call to printf or sprintf is generated (which might also be unable to
parse the format).
253 Too few parameters for (s)printf format.
This error is generated when there are
fewer parameters to a call to printf or sprintf than the format string calls for and the inline
generation of printf calls is requested. For example:
printf("x = %4d\n");
254 Too many parameters for (s)printf format.
This warning is generated when there
are more parameters to a call to printf or sprintf than the format string calls for and the
inline generation of printf calls is requested. For example:
printf("x = %4d\n", x, y);
The format string is parsed, and the extra arguments are ignored.
255 Missing declaration of (s)printf helper function, variable, or field.
This warning is
generated when the compiler has not seen the prototypes for the printf or sprintf helper
functions it generates calls to. This occurs if the standard include file stdio.h has not been
included or if stdio.h from a different release of ZDS II has been included.
256 Cannot preprocess calls to vprintf or vsprintf.
This message is generated when the
code contains calls to vprintf or vsprintf and the inline generation of printf calls is
requested. The reason for this warning and the solutions are similar to the ones for mes-
sage 201: Can’t preprocess format to (s)printf.
257 Not all paths through “
The function declared with a
return type is not returning any value at least on one path in the function.
Code Generator Warning and Error Messages
303 Case value <number> already defined.
If a case value consists of an expression
containing a
sizeof
, its value is not known until code generation time. Thus, it is possi-