Liste des Groupes | Revenir à cl c |
On Wed, 21 Aug 2024 10:01:12 -0300The warning cake gives is "use after free" or use after fclose.
Thiago Adams<thiago.adams@gmail.com> wrote:
For this type of error you need my static analyzer. (cake) :DUnnecessary. MSVC -W4 gives a warning.
>
#include <cstdio>
void foo()
{
FILE* f = fopen("file1.txt", "r");
if (FILE* f = fopen("file2.txt", "r")) {
fclose(f);
}
if (f)
fclose(f);
}
scopes.cpp(6): warning C4456: declaration of 'f' hides previous local
declaration scopes.cpp(5): note: see declaration of 'f'
Les messages affichés proviennent d'usenet.