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

From: Alex Pilon <alp_AT_alexpilon.ca>
Date: Fri, 13 Oct 2017 19:57:16 -0400

On Fri, Oct 13, 2017 at 10:29:41AM +0000, sylvain.bertrand_AT_gmail.com wrote:
> I would go #define and not direct "static const".
>
> Because I think "const" is part of the excess syntax of C and should be
> optional (and treated as an optional variable attribute).

You really don't think we should enforce preventing people from doing stupid
things? Might not matter *as much* without concurrency, and it's only
compile-time rather than run-time meaningful for non-stack variables due to
most processors' memory model.

But it's unfortunately still useful to prevent people from doing stupid things.

I just wouldn't expect people to const everything that can or should be.
Received on Sat Oct 14 2017 - 01:57:16 CEST

This archive was generated by hypermail 2.3.0 : Sat Oct 14 2017 - 02:00:18 CEST