On 2024-11-21 10:25:41 +0100, Domingo Alvarez Duarte wrote: > After Vicent Lefevre message I looked again at it and did the experimental > change sown bellow, the original code is a bit problematic because it has > "9" hardcoded in "#define __TINYC__ 9%.2s\n" and was using a substring of > "0.9.28rc", not the best solution but a bit more clear in my opinion. > > ==== > > #define TCC_VERSION_MAJOR "0.9." > #define TCC_VERSION_MINOR "28rc" > #define TCC_VERSION TCC_VERSION_MAJOR TCC_VERSION_MINOR > > ==== > > ==== > > cstr_printf(cs, "#define __TINYC__ 9%.2s\n", TCC_VERSION_MINOR); > > ====
Yes, this is better. In particular, the current "+ 4" may be incorrect at the next major version if it becomes 10 (thus with 2 digits)! What is the version naming convention? BTW, if in the next major version, the minor version has a single digit, this will still be incorrect (the current code is affected too). -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel