tech:notes_langage_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:notes_langage_c [2026/10/27 16:34] – Jean-Baptiste | tech:notes_langage_c [2026/11/03 11:06] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 160: | Ligne 160: | ||
| free(ptr); | free(ptr); | ||
| ~~~ | ~~~ | ||
| + | |||
| + | |||
| + | ## Debug | ||
| + | |||
| + | Valgrind et autres | ||
| + | |||
| + | * -g : pour conserver les symboles de débogage et afficher les numéros de ligne précis | ||
| + | * -O0 : pour désactiver les optimisations du compilateur | ||
| + | |||
| + | ~~~bash | ||
| + | gcc -g -O0 mon_programme.c -o mon_programme | ||
| + | gcc -Wall -Wextra -Werror -ggdb -O0 -std=gnu17 -o hello_world hello_world.c | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | gcc -o executable -std=c11 -Wall main.c | ||
| + | gcc -o executable -std=c11 -Wall -ggdb3 main.c | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Valgrind | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * heaptrack | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | valgrind --leak-check=yes ./ | ||
| + | valgrind --leak-check=full --show-leak-kinds=all ./ | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | valgrind --leak-check=full \ | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | ~~~ | ||
| + | |||
tech/notes_langage_c.1793115272.txt.gz · Dernière modification : de Jean-Baptiste
