Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

2 months ago

Language

C++

Compiler

gcc 12.3.0

Options
Warnings
Don't Use Boost
C++2b
-pedantic-errors

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];
      |                             ^
Exit Code:
0