Advertisement
dmkozyrev

temp.cpp

May 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. /*
  2.     file: "temp.cpp"
  3.    
  4.     gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)
  5.    
  6.     $ g++ -std=c++11 -Wall -Wextra -pedantic -O2 temp.cpp -o temp.o
  7.     temp.cpp: In function ‘int main()’:
  8.         temp.cpp:19:28: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘int64_t {aka long int}’ [-Wformat=]
  9.         printf("%lld\n", number);
  10.                             ^
  11.     temp.cpp:20:47: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
  12.         printf("sizeof(long) = %u\n", sizeof(long));
  13.                                                ^
  14.     $ ./temp.o
  15.     1
  16.     sizeof(long) = 8
  17. */
  18.  
  19.  
  20. #pragma GCC diagnostic ignored "-Wunused-result"
  21. #include <cstdio>
  22. #include <cstdint>
  23.  
  24. int main() {
  25.     int64_t number = 1;
  26.     printf("%lld\n", number);
  27.     printf("sizeof(long) = %u\n", sizeof(long));
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement