Guest User

Untitled

a guest
Jul 12th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <cs50.h>
  3.  
  4. int main (void)
  5. {
  6. int i = get_int("Integer: ");
  7. printf("hello, %i\n", i);
  8. }
  9.  
  10. $ make int
  11. clang -fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wshadow int.c -lcrypt -lcs50 -lm -o int
  12. int.c:5:13: error: implicit declaration of function 'get_int' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  13. int i = get_int("Integer: ");
  14. ^
  15. int.c:6:21: error: more '%' conversions than data arguments [-Werror,-Wformat]
  16. printf("hello, %i\n");
  17. ~^
  18. int.c:5:9: error: unused variable 'i' [-Werror,-Wunused-variable]
  19. int i = get_int("Integer: ");
  20. ^
  21. 3 errors generated.
  22. make: *** [int] Error 1
Add Comment
Please, Sign In to add comment