Re: [dev] [general][discussion] constants: `#define` or `static const`

2017-10-12 Thread Laslo Hunhold
On Thu, 12 Oct 2017 15:21:14 +0100 Matthew Parnell wrote: Hey Matthew, > Afternoon suckless community. > > It is made clear in the suckless coding style guide when to use > #define and enums; however, it doesn't mention general global > constants. as a general rule of thumb I think it's valid

Re: [dev] [general][discussion] constants: `#define` or `static const`

2017-10-12 Thread Kamil CholewiƄski
Hi Matthew, I'd go with "static const" unless you have a reason to do otherwise. As you pointed out: type checking, scope, etc. but also: you can't take the address of a #define and pass it around as a pointer. Ultimately it boils down to style. Use whatever you think best communicates the *inten

[dev] [general][discussion] constants: `#define` or `static const`

2017-10-12 Thread Matthew Parnell
Afternoon suckless community. It is made clear in the suckless coding style guide when to use #define and enums; however, it doesn't mention general global constants. I would search through the mailing list to see if this has been asked before; but it seems that gmane fails to search. I'm writin