https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63619

            Bug ID: 63619
           Summary: warning: deleting ‘void*’ is undefined has no -W flag
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fuscated at gmail dot com

Save this snippet in delete_void.cpp
int main() {
    void *a=new char[100];
    delete [] a;
    return 0;
}

$ g++ -fdiagnostics-show-option delete_void.cpp 
delete_void.cpp: In function ‘int main()’:
delete_void.cpp:3:12: warning: deleting ‘void*’ is undefined
  delete [] a;
            ^
The compiler poroduces a warning, but doesn't allow the user to turn it into
error and thus such bugs cannot be detected at compile time.

Reply via email to