다음을 통해 공유


컴파일러 오류 C2357

'identifier': 'type' 형식의 함수여야 합니다.

코드는 컴파일러에서 atexit 내부적으로 선언한 버전과 일치하지 않는 함수 버전을 선언합니다. 다음과 같이 선언 atexit 합니다.

int __cdecl atexit(void (__cdecl *)());

자세한 내용은 init_seg 참조하세요.

다음 샘플에서는 C2357을 생성합니다.

// C2357.cpp
// compile with: /c
// C2357 expected
#pragma warning(disable : 4075)
// Uncomment the following line to resolve.
// int __cdecl myexit(void (__cdecl *)());
#pragma init_seg(".mine$m",myexit)