Closed sober-wang closed 1 year ago
How to fix this error message?
go build -o bin/ . # github.com/cpuguy83/containerd-shim-systemd-v1 pty.c: 在函数‘handle_tty_op_conn’中: pty.c:76:18: 警告:‘write’ reading 8 bytes from a region of size 4 [-Wstringop-overflow=] 76 | nw = write(fd, sizeof(msg)+msg, sizeof(msg)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from pty.c:5: /usr/include/unistd.h:378:16: 附注:in a call to function ‘write’ declared with attribute ‘read_only (2, 3)’ 378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur | ^~~~~
Env
Hmm... I'm not sure why I am adding sizeof to what's being read. Probably can get rid of that.
This is fixed. Thanks!
How to fix this error message?
Env