As long as variables are declared const, it's not a real problem I
guess. Technically, if they are const, they are no variables anymore.

At least one knows immediately that the global "variables" are
constants, otherwise we would have used functions for sure. And one
never knows whether a function always returns  a constant or not. So, I
feel like global functions are worse than const global variables, but
better than non-const global variables.

Vincent

Isn't there a GCC warning about const return values of functions?
Declaring return values as const makes not much sense:

extern const int lyx_version_major;
int i = lyx_version_major;
i++;

is also possible, as

int lyx_version_major();
int i = lyx_version_major();
i++;

So you could ignore the const of the return value because
it  will not influence the value which will be returned the
next time.

Seeing all the problems with extern & Co. I think a
macro is even bette
r than all the "extern const".

Or couldn't we use a sruct?

struct LyxVersion {
  LyxVersion();
  int version;
  int major;
  int minor;
  int patch;
};

We are not forced to look like a C project.

Peter

Reply via email to