https://bugs.documentfoundation.org/show_bug.cgi?id=166146
--- Comment #11 from Mike Kaganski <[email protected]> --- (In reply to sgerber from comment #10) > I have not worked in the LibreOffice codebase before. Please, point me in > the right direction. To build LibreOffice, please follow https://wiki.documentfoundation.org/Development, and specifically, a topic under "General Programming Guidelines" there that matches your environment. As to this problem, the current implementation looks up the const definition; tries to find the literal value from it; if it's not a literal, it tries to look up another constant in the same module; and if failed, it just errors out from compilation (and if it succeeded to fins the literal value, it then substitutes the instances of the constant with that literal). I think, that instead of throwing the error, it should remember the symbol it references to; and then, it should replace all instances of the const with that symbol. But then, it needs to make sure *at runtime*, that the symbol itself is const (so it would have to add some runtime code, which could throw a runtime error). I think that it is not correct to allow initializing the const with a non-const from another module (when the same is prohibited by the language inside the module). Or maybe not replace the const with the symbol, but introduce a "fixed variable" named after the const, with some initialization code (again, needs checking that it is initializing with a constant value). -- You are receiving this mail because: You are the assignee for the bug.
