Skip to content

Instantly share code, notes, and snippets.

@diversario
Created July 31, 2015 05:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diversario/68aa3fd723b3cd05881e to your computer and use it in GitHub Desktop.
Save diversario/68aa3fd723b3cd05881e to your computer and use it in GitHub Desktop.
➜ lcthw make all
cc -Wall -g ex1.c -o ex1
cc -Wall -g ex3.c -o ex3
cc -Wall -g ex4.c -o ex4
ex4.c:9:17: warning: more '%' conversions than data arguments [-Wformat]
printf("I am %d years old.\n");
~^
ex4.c:10:17: warning: more '%' conversions than data arguments [-Wformat]
printf("I am %d inches tall.\n");
~^
ex4.c:6:7: warning: unused variable 'age' [-Wunused-variable]
int age = 10;
^
ex4.c:7:7: warning: unused variable 'height' [-Wunused-variable]
int height;
^
4 warnings generated.
➜ lcthw valgrind ./ex4
==86991== Memcheck, a memory error detector
==86991== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==86991== Using Valgrind-3.11.0.SVN and LibVEX; rerun with -h for copyright info
==86991== Command: ./ex4
==86991==
I am 75507888 years old.
I am 256 inches tall.
==86991==
==86991== HEAP SUMMARY:
==86991== in use at exit: 38,994 bytes in 420 blocks
==86991== total heap usage: 515 allocs, 95 frees, 45,834 bytes allocated
==86991==
==86991== LEAK SUMMARY:
==86991== definitely lost: 0 bytes in 0 blocks
==86991== indirectly lost: 0 bytes in 0 blocks
==86991== possibly lost: 0 bytes in 0 blocks
==86991== still reachable: 0 bytes in 0 blocks
==86991== suppressed: 38,994 bytes in 420 blocks
==86991==
==86991== For counts of detected and suppressed errors, rerun with: -v
==86991== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment