summaryrefslogtreecommitdiffstats
path: root/termios.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-04-06 06:49:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-04-06 06:49:45 -0700
commitd104ccf947c66035850048e044e76a4dfb4dec7f (patch)
treeaf6b37a204776559b469bb748f3a8dde04674fad /termios.c
parent9e4be16274554d469b64e5b240b04fe8549f8a1f (diff)
downloadtxr-d104ccf947c66035850048e044e76a4dfb4dec7f.tar.gz
txr-d104ccf947c66035850048e044e76a4dfb4dec7f.tar.bz2
txr-d104ccf947c66035850048e044e76a4dfb4dec7f.zip
warning cleanup: GNU C++ initializer warnings.
This is the eight and final round of an effort to enable GCC's -Wextra option. The C++ compiler, with -Wextra, doesn't like C's universal struct initializer { 0 }, individually complaining about all the remaining members not being initialized. What works in C++ is the { } initializer. Conditional definition to the rescue. * lib.h (all_zero_init): New macro which expands to { } under C++, and { 0 } under C. * lib.c (make_time_impl, epoch_tm, time_string_meth, time_parse_meth): Use all_zero_init. * parser.c (prime_parser): Likewise. * socket.c (sock_mark_connected): Likewise. * sysif.c (fcntl_wrap): Likewise. * termios.c (encode_speeds, decode_speeds): Likewise. * configure (diag_flags): Add -Wextra.
Diffstat (limited to 'termios.c')
-rw-r--r--termios.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/termios.c b/termios.c
index 6179f2b5..5d7b26b0 100644
--- a/termios.c
+++ b/termios.c
@@ -337,7 +337,7 @@ static val tcflow_wrap(val action, val stream)
static val encode_speeds(val termios)
{
- struct termios tio = { 0 };
+ struct termios tio = all_zero_init;
tio.c_iflag = c_num(slot(termios, iflag_s));
tio.c_cflag = c_num(slot(termios, cflag_s));
@@ -351,7 +351,7 @@ static val encode_speeds(val termios)
static val decode_speeds(val termios)
{
- struct termios tio = { 0 };
+ struct termios tio = all_zero_init;
tio.c_cflag = c_num(slot(termios, cflag_s));
tio.c_iflag = c_num(slot(termios, iflag_s));