Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Function function_name was previously defined with a different parameter list at file_name(line_number). Some analysis tools will yield incorrect results
Remarks
This warning almost always accompanies Compiler Warning (level 1) C4028. Both warn of a mismatch between the parameters of a function's declaration and its definition. However, this specific error indicates a more niche case than C4028. C28208 indicates not only that a mismatch exists, but that it also can cause issues with analysis tools. This warning most notably occurs when the mismatch exists between a typedef function pointer and the definition of that function. This warning is demonstrated in the example below.
Code analysis name: FUNCTION_TYPE_REDECLARATION
Example
The following code generates C28208. test_type declares my_test1 and my_test2 to take a void* parameter, but the definition of my_test1 takes an int* parameter instead. my_test2 avoids this issue because the definition parameters match the declaration parameters.
// c28208_example.h
typedef void test_type(void*);
// c28208_example.cpp
#include "c28208_example.h"
test_type my_test1;
test_type my_test2;
void my_test1(int* x){} // Generates C28208
void my_test2(void* x){} // Doesn't generate C28208
int main()
{
// Code
}