PiotrZSL wrote: > > * The auto-fix should be configurable to choose `static` or anonymous > > namespace. > > Should I implement auto-fix for this check? Maybe some functions / variables > will be marked incorrectly and cause link error because the coder just forget > to include the header file but this check mark it as internal linkage. WDYT? > @carlosgalvezp @PiotrZSL @EugeneZelenko @SimplyDanny
YES. I used such check on a project that I work for. In short it found over an 1000 issues, manually fixing them was not an option. I had an quick fix with adding `static`, and that worked fine, in some places code didn't compile so had to fix those by my self, but that was fine. Add an option for "static / anonymous namespace", and generate fixes/hints accordingly. You can use optional values, or enums and by default suggest one or other, and in such state you may not need to provide fixes. In other config state just provide fixes, even if that would mean wrapping every function in separate anonymous namespace or adding static. There allways can be other check or some clang-format option to merge multiple namespaces. Do not reorder functions, and one can use other. Also static is safer as it's does not change scope, with namespace user may run into issues, but still fixes are needed. You can always mention in documentation that fixes are not perfect and manual intervention may be required. Even if check will do 80% of job, thats already huge help. https://github.com/llvm/llvm-project/pull/90830 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits