Skip to content

Commit 2746e03

Browse files
committed
i3bar: work around weird clang compiler behavior
clang used to not warn (= error, with -Werror) about this line. Oh well.
1 parent e107254 commit 2746e03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

i3bar/src/xcb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,9 @@ static void send_tray_clientmessage(void) {
15151515
static void init_tray(void) {
15161516
DLOG("Initializing system tray functionality\n");
15171517
/* request the tray manager atom for the X11 display we are running on */
1518-
char atomname[strlen("_NET_SYSTEM_TRAY_S") + 11];
1518+
/* The following line cannot use strlen as that makes compilation fail with
1519+
* some versions of clang (-Wgnu-folding-constant): */
1520+
char atomname[18 /* strlen("_NET_SYSTEM_TRAY_S") */ + 11];
15191521
snprintf(atomname, strlen("_NET_SYSTEM_TRAY_S") + 11, "_NET_SYSTEM_TRAY_S%d", screen);
15201522
xcb_intern_atom_cookie_t tray_cookie;
15211523
if (tray_reply == NULL) {

0 commit comments

Comments
 (0)