Language
C++
Compiler
gcc 12.3.0
Options
Warnings
Don't Use Boost
C++2b
-pedantic-errors
$ g++ prog.cc -Wall -Wextra -std=c++2b -pedantic-errors
Exit Code:
0
Author
anonymous
2 months ago
C++
gcc 12.3.0
Author
anonymous
2 months ago
$ g++ prog.cc -Wall -Wextra -std=c++2b -pedantic-errors
prog.cc: In function 'int main()':
prog.cc:6:11: warning: 'void* memset(void*, int, size_t)' writing 33 bytes into a region of size 32 overflows the destination [-Wstringop-overflow=]
6 | memset(name, 0, 33);//オーバーフロー
| ~~~~~~^~~~~~~~~~~~~
prog.cc:5:29: note: destination object of size 32 allocated by 'operator new []'
5 | char *name = new char[32];
| ^