On 2020-01-28 16:46, Alex Peshkoff via Firebird-devel wrote:
On 2020-01-28 16:41, Dimitry Sibiryakov wrote:
28.01.2020 13:26, Alex Peshkoff via Firebird-devel wrote:
Modern code does not use defines for constants.
Certainly, but the problem is with old one, particular consts_pub.h.
It is a matter of one-time copy-paste and search-and-replace.
Perhaps, sed can transform all "#define XXX NNN" into "const int XXX
= NNN;" in one pass.
awk definitely can
Sorry - pressed send too early.
There is at least one seen at once problem with using
const type XXX = NNN;
in plain C - "const declarations do not produce constant expressions,
i.e. in C you can't use a const int object in a case label", which is
very typical usage of constants in consts_pub.
Full text is here:
https://stackoverflow.com/questions/5248571/is-there-const-in-c
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel