Clang Flag: -Wdelete-incomplete / -Wno-delete-incomplete

From emmtrix Wiki
Jump to navigation Jump to search
-Wno-delete-incomplete is a compiler flag in Clang designed for controlling specific warning messages related to deletion operations on incomplete types. When active, this flag suppresses two main categories of warnings:
  • Attempts to delete an expression with a pointer to a void type.
  • Deleting a pointer to an incomplete type, which might lead to undefined behavior.

Developers can deactivate these warnings by using the -Wno-delete-incomplete flag. This feature is particularly useful for suppressing warnings in codebases where such deletion operations are known and intended by the developer, thereby reducing noise in the compilation output.

 
AI Generated

Supergroups

Subroups

Warnings/Remarks

Default Active (Deactivate with -Wno-delete-incomplete)

ext_delete_void_ptr_operand warning: cannot delete expression with pointer-to-'void' type A
warn_delete_incomplete warning: deleting pointer to incomplete type A may cause undefined behavior

Default Inactive (Activate with -Wdelete-incomplete)

None