datum.cpp: In function 'int32_t main()':
datum.cpp:30:21: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int64_t' {aka 'long int'} [-Wformat=]
30 | sprintf(ss, "%02d%02d%04d", d, m, y);
| ~~~^ ~
| | |
| int int64_t {aka long int}
| %02ld
datum.cpp:30:25: warning: format '%d' expects argument of type 'int', but argument 4 has type 'int64_t' {aka 'long int'} [-Wformat=]
30 | sprintf(ss, "%02d%02d%04d", d, m, y);
| ~~~^ ~
| | |
| int int64_t {aka long int}
| %02ld
datum.cpp:30:29: warning: format '%d' expects argument of type 'int', but argument 5 has type 'int64_t' {aka 'long int'} [-Wformat=]
30 | sprintf(ss, "%02d%02d%04d", d, m, y);
| ~~~^ ~
| | |
| int int64_t {aka long int}
| %04ld
datum.cpp:44:14: warning: format '%d' expects argument of type 'int', but argument 2 has type 'int64_t' {aka 'long int'} [-Wformat=]
44 | printf("%02d.%02d.%04d.\n", res % M, (res % Y) / M, res / Y);
| ~~~^ ~~~~~~~
| | |
| int int64_t {aka long int}
| %02ld
datum.cpp:44:19: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int64_t' {aka 'long int'} [-Wformat=]
44 | printf("%02d.%02d.%04d.\n", res % M, (res % Y) / M, res / Y);
| ~~~^ ~~~~~~~~~~~~~
| | |
| int int64_t {aka long int}
| %02ld
datum.cpp:44:24: warning: format '%d' expects argument of type 'int', but argument 4 has type 'int64_t' {aka 'long int'} [-Wformat=]
44 | printf("%02d.%02d.%04d.\n", res % M, (res % Y) / M, res / Y);
| ~~~^ ~~~~~~~
| | |
| int int64_t {aka long int}
| %04ld
datum.cpp:30:30: warning: '__builtin___sprintf_chk' writing a terminating nul past the end of the destination [-Wformat-overflow=]
30 | sprintf(ss, "%02d%02d%04d", d, m, y);
| ^
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/10/cstdio:42,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:46,
from datum.cpp:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: '__builtin___sprintf_chk' output between 9 and 18 bytes into a destination of size 8
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~