- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Why Inspector complain about this code fro mismatched alloc/dealloc? Very strange to me.
int _tmain(int argc, _TCHAR* argv[])
{
int *p = NULL;
p = new int[5];
delete[] p;
return 0;
}
- Marcas:
- CC++
- Debugging
- Development Tools
- Fortran
- Intel® Inspector
- Optimization
- Parallel Computing
- Vectorization
Link copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Just FYI, build with Debug and Inspector doesn't complain about it.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Ah, I was using Visual C++ compiler. After switching to Intel Compiler, the false warning is gone for both Release and Debug. Anyone cares to explain why? Thanks.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
It looks like Inspector thinks you are allocating using "new" instead of "new[]".
Depending on the compiler and the header files you are using it can difficult to disambiguate the symbol names.
As you mention it looks like a false warning in this case.
Let me know if you have any questions.
Regards,
Kevin
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Thanks for replying. No more issues after switching to Intel compilers.

- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora