Dear Basile and other GCC friends, I may have not been clear about the purpose of my code. It does not analyze code, it merely formats / constructs diagnostics for printing to a terminal.
I am looking to perhaps contribute the format or presentation of this tool to GCC as an option, utilizing the existing diagnostics and code analysis already built into GCC, and merely presenting it in a different manner. Thank you, Tuur Martens On Monday, February 3rd, 2025 at 11:48 AM, Basile Starynkevitch <bas...@starynkevitch.net> wrote: > Then look also into https://frama-c.com/ and > https://github.com/bstarynk/bismon > and https://nwcc.sourceforge.net/ and https://bellard.org/tcc/ > > > As far as I understand, GCC code needs to be GPL licensed with a copyright > assignment contract to the FSF. (See > https://gcc.gnu.org/legacy-ml/gcc/2006-12/msg00008.html > and https://arxiv.org/abs/1109.0779 ....) > > regarding your fancy diagnostic system, consider working at the GIMPLE level > and > implementing it (at first) as an open source GCC plugin. > https://gcc.gnu.org/onlinedocs/gccint/GIMPLE.html > https://gcc.gnu.org/onlinedocs/gccint/Plugins.html > > Be aware that GCC extensions (e.g. your open source plugin) will use GCC > functions for diagnostics. > > By working on GIMPLE representation your code analyzer would be usable on most > of the languages having a GCC frontend. You probably want to extend the > existing > GCC static analysis infrastructure: > https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html > in relation with GCC link-time optimizations abilities. > > Regarding specifically C++ and its template machinery, you probably would have > issues in analyzing C++ template code. As far as I understand this is an > undecidable problem, so needs years of research (and could give you some PhD). > A naïve insight would be, for improving C++ template diagnostics, to try to > instanciate C++ template code (e.g. Boost libraries) with some guessed types. > I > have no idea of how to achieve this. > > Do you want to use machine learning techniques to improve your diagnostic tool > mjolnir? Perhaps some code from https://github.com/RefPerSys/RefPerSys/ (a GPL > licensed inference engine project) could be useful for your tool? > > Regards from near Paris in France > -- > Basile STARYNKEVITCH bas...@starynkevitch.net > > 8 rue de la Faïencerie > 92340 Bourg-la-Reine, France > http://starynkevitch.net/Basile & https://github.com/bstarynk