This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/65490] New: terminals.c:1266:21: warning: argument to âsizeofâ in âbzeroâ call is the same expression as the destination
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 Mar 2015 10:37:40 +0000
- Subject: [Bug ada/65490] New: terminals.c:1266:21: warning: argument to âsizeofâ in âbzeroâ call is the same expression as the destination
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65490
Bug ID: 65490
Summary: terminals.c:1266:21: warning: argument to âsizeofâ in
âbzeroâ call is the same expression as the destination
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: vries at gcc dot gnu.org
warning:
...
terminals.c:1266:21: warning: argument to âsizeofâ in âbzeroâ call is the same
expression as the destination; did you mean to remove the addressof?
[-Wsizeof-pointer-memaccess]
...
terminals.c:
...
static int
child_setup_tty (int fd)
{
struct termios s;
int status;
/* ensure that s is filled with 0 */
bzero (&s, sizeof (&s));
/* Get the current terminal settings */
status = tcgetattr (fd, &s);
...
We should either fix bzero as the warning suggests, or remove bzero.
It not clear to me why bzero is needed before tcgetattr. Perhaps this is some
insurance against dodgy implementations of tcgetattr which do not set the full
struct s?