Re: [dev] dwm alpha patch: const isn't a const??

From: Jochen Sprickerhof <dwm_AT_jochen.sprickerhof.de>
Date: Sun, 26 May 2019 10:36:54 +0200

Hi Paul,

* Paul Swanson <psw_AT_protonmail.com> [2019-05-26 08:05]:
>I've a fresh clone of dwm and the dwm alpha patch (20180613-b69c870) and it's generating
>the following error:
>
> dwm.c
> In file included from dwm.c:280:0:
> config.h:24:27: error: initializer element is not constant
> [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
> ^~~~~~~~
> config.h:24:27: note: (near initialization for ‘alphas[0][1]’)
> config.h:24:37: error: initializer element is not constant
>
>What I can't understand, is the fact that 'baralpha', and all the other variables
>accused of not being constants are in fact declared as "static const unsigned int":
>
> static const unsigned int baralpha = 0xd0;
> static const unsigned int borderalpha = OPAQUE;
>
>If I substitute the initialising variables for a numeric literal (ie. 1) it compiles.
>But if I leave the constants from the patch or make my own, it fails.
>
>How can a const, not be a const?
>
>Any help would be greatly appreciated.

dwm-alpha-20180613-b69c870.diff is changing your config.def.h:

http://git.suckless.org/sites/file/dwm.suckless.org/patches/alpha/dwm-alpha-20180613-b69c870.diff.html#l23

make sure you adopt your config.h accordingly.

See: http://dwm.suckless.org/customisation/

Cheers Jochen

Received on Sun May 26 2019 - 10:36:54 CEST

This archive was generated by hypermail 2.3.0 : Sun May 26 2019 - 12:12:08 CEST