I might be missing something, but I would like to have had a --pedantic or --warning option on Zig 0.15 (zig build and zig build-exe) to find things that have been deprecated in 0.15 or earler version but still work (in 0.15). I am referring to language constructs that might no longer work in some future version, some expected library changes (managed versions). Here is why:
I have code that I started a few years ago, and that I have upgraded for various compiler/library changes over the years. I have test for this code, but as soon as I start making changes for a new version (such as now for 0.16), I cannot run those tests until everything has been upgraded/fixed for the new version and it compiles again. In this particular case, after making several changes for 0.16 based on what the compiler complained about, I found that in some places I still use .{} (from a pre-0.14 period), instead of .empty ( which I use for any new code I write).
I would much prefer to have changed all of the .{} before doing any of the 0.16 changes, so that I could still run my tests (with 0.15) after that bunch of changes. Now, in order to allow for immediate testing, I have to roll-back my 0.16 specific changes, update .{} to .empty everywhere applicable, run tests. And after that re-apply the 0.16 specific changes necessary, that I previously found, after that fixing the next thing 0.16 complains about. And I have to hope that I don’t find anything else I could have done in 0.15, that I makes me want to roll-back to 0.15 only code, so I can test everything before proceeding.
I could of course re-read the release notes of the last few releases ( re-read because I tend to not understand and/or appreciate the significance of some of the changes on first reading), And then read through all of my 0.15 code, and update it before switching to 0.16. But it is easy to miss things and it woud be nice if the compiler helped with finding at least some of these depreciations, I would also be less likely to postpone “fixing” these until things no longer compile, if I had some automated way of finding the majore culprits.
I have no idea how difficult this is to implement. Or if this rather should be different (sub)command for zig or an option to the commands build and build-exe. It could also be some separate tool. For me this also doesn’t have to be in the first release of a new minor version (0.X.0), but it would be nice to have it later on, to clean up code before upgrading.
Is there some tool or zig option that I missed, that can analyse my 0.15 Zig code?