หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
The #warning directive emits a user-specified warning message at compile time. It doesn't stop compilation. This directive is available starting in C23 and C++23.
Syntax
#warning token-string
Remarks
The warning message is the token-string parameter. The token-string parameter isn't subject to macro expansion and can be optionally enclosed in quotes.
Use this directive to inform the developer of a nonfatal issue or to communicate other important information during compilation.
The following example shows how to use the #warning directive:
#if defined(_LEGACY_FEATURE_FLAG)
#warning "_LEGACY_FEATURE is deprecated and should not be used."
#endif