Avoid bzero in xfce4-session
When trying to build Xfce 4.20pre1 on Solaris 11.4, the xfce4-session
compilation failed:
/vol/xfce/src/xfce-4.20pre1/xfce4-session-4.19.3/xfce4-session/xfsm-chooser.c: In function ‘xfsm_chooser_get_session’:
/vol/xfce/src/xfce-4.20pre1/xfce4-session-4.19.3/xfce4-session/xfsm-chooser.c:107:3: error: implicit declaration of function ‘bzero’ [-Wimplicit-function-declaration]
107 | bzero (&value, sizeof (value));
| ^~~~~
/vol/xfce/src/xfce-4.20pre1/xfce4-session-4.19.3/xfce4-session/xfsm-chooser.c:107:3: warning: incompatible implicit declaration of built-in function ‘bzero’ [-Wbuiltin-declaration-mismatch]
make[3]: *** [Makefile:805: xfce4_session-xfsm-chooser.o] Error 1
and two more instances:
xfce4-session-4.19.3/xfce4-session/xfsm-legacy.c: bzero (&ev, sizeof (ev));
xfce4-session-4.19.3/xfce4-session/xfsm-dns.c: bzero (&hints, sizeof (hints));
On Solaris, the declaration of bzero
requires the inclusion of <strings.h>
, which is used nowhere else in the Xfce code base and requires an autoconf test since the header isn't standardized and cannot be assumed to present.
Instead, it would be way better to switch these 3 instances to memset
instead, as has already been done throughout the code base.