|
|
|||||||||||||||||||||||||||
![]() |
![]() |
||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||
|
|
|
|
|||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||
|
|
|
|
|||||||||||||||||||||||||
|
6.4.3 Test FunctionsFunction declarations in test programs should have a prototype conditionalized for C++. In practice, though, test programs rarely need functions that take arguments.
Functions that test programs declare should also be conditionalized for C++, which requires `extern "C"' prototypes. Make sure to not include any header files containing clashing prototypes.
If a test program calls a function with invalid parameters (just to see
whether it exists), organize the program to ensure that it never invokes
that function. You can do this by calling it in another function that is
never invoked. You can't do it by putting it after a call to
If you include any header files, make sure to call the functions
relevant to them with the correct number of arguments, even if they are
just 0, to avoid compilation errors due to prototypes. GCC version 2
has internal prototypes for several functions that it automatically
inlines; for example,
|
|
|||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||
|
Marketplace: | |||||||||||||||||||||||||||
| " Artificial Intelligence: the art of making computers that behave like the ones in movies. " | |||||||||||||||||||||||||||