
Changing the Compiler’s Behavior With Options
2-18
2.3.6 Options That Overlook ANSI C Type Checking
Following are options that you can use to overlook some of the strict ANSI C
type checking on your code:
−
tf
Overlooks type checking on redeclarations of prototyped func-
tions. In ANSI C, if a function is declared with an old-format decla-
ration and later declared with a prototype (as in the example be-
low), this generates an error because the parameter types in the
prototype disagree with the default argument promotions (which
convert float to double and char to int).
int func( )
/* old format */
int func(float a, char b)
/* new format */
−
tp
Overlooks type checking on pointer combinations. This option has
two effects:
-
A pointer to a signed type can be combined in an operation with
a pointer to the corresponding unsigned type:
int *pi;
unsigned *pu;
pi = pu; /* Illegal unless -tp used */
-
Pointers to differently qualified types can be combined:
char *p;
const char *pc;
p = pc; /* Illegal unless -tp used */
The
−
tp option is especially useful when you pass pointers to
prototyped functions, because the passed pointer type would ordi-
narily disagree with the declared parameter type in the prototype.
Содержание TMS320C2x
Страница 8: ...viii...
Страница 69: ...2 47 C Compiler Description...
Страница 159: ...6 36...
Страница 226: ...8 6...
Страница 250: ...Index Index 14 Z z shell option 2 2 2 4 2 14 overriding with c option 4 5 overriding with n option 2 13...