TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - C Coding Standard
Search

SR:  2.5.4#1

Synopsis:String literals must have a formally defined value.
Language:C
Severity Level:2
Category:LEXICAL CONVENTIONS


Description:
String literals must be correctly terminated by a null or ". It is possible using the # operator in the pre-processor to construct a macro which can expand to an undefined string in some circumstances.

Example:

#define	str(x)	#x
char	fred[]=str(fred\\\\\\\\\\\\\\\\);
In this example, the string is not terminated correctly and hence the result is undefined.