News for hackers. Stuff that matters.
Re:IKOS: Static analyzer for C/C++ based on the theory of Ab... by marcodiego on Wednesday April 20, 2022 @03:00PM (#31101403)
I wouldn't consider C++ Builder as C++. Have not used it in ages, but last time I used it, it was not C++. Anyway, that's is not exactly what I was talking about. I think even the tools you listed lacked years behind useful features that eclipse and netbeans implemented for java like refactoring.

I'm glad there are good front-ends to the llvm language server though and that static analyzers are slowly improving and becoming more popular even to the sporadic hobbyist.

Re:IKOS: Static analyzer for C/C++ based on the theory of Ab... by Someone on Wednesday April 20, 2022 @03:58PM (#31102139)
That’s because the preprocessor adds too much flexibility to make it easy to write such tools.

Once you have

   #ifdef FOO
   ...
   #else
   ...
   #endif
you have to completely preprocess the compilation unit to find out which branch is taken. That means you have to interpret the build script (which may do -DFOO, possibly only for some compilation targets)

You have to do that even for such simple things as syntax coloring. Now, you say “I simply parse both branches, check what things they define, somehow merge the two, and we’re good to go”. That won’t work, as the not taken branch(es) need not contain valid C/C++, and their validity may depend on whether other branches are taken.

the preprocessor also has concatenation (https://gcc.gnu.org/onlinedocs/cpp/Concatenation.html). That makes writing a refactoring tool as good as impossible (for example, how do you rename quit_command to commandExit in the example on that page?)

Now, lots of code is fairly reasonable in its use of the preprocessor, but writing a reliable tool is a lot harder, if it’s possible at all, than with Java.

Re:IKOS: Static analyzer for C/C++ based on the theory of Ab... by marcodiego on Wednesday April 20, 2022 @04:12PM (#31102346)
Thanks for the reasonable view and explanation.
Re:IKOS: Static analyzer for C/C++ based on the theory of Ab... by pjmlp on Wednesday April 20, 2022 @03:30PM (#31101741)
C++ Builder compiles C++, thus it is C++.

I will never understand why clang and GCC extensions are considered part of C or C++, while other compilers aren't.

Refactoring exists for 20 years in Visual Studio with plugins like Visual Assist.

The tools I mentioned as ahead of their time allowed for a Lisp Machines or Smalltalk like experience for C++, respectively.

Re:IKOS: Static analyzer for C/C++ based on the theory of Ab... by marcodiego on Wednesday April 20, 2022 @04:02PM (#31102199)
> C++ Builder compiles C++, thus it is C++.

By your definition.

> I will never understand why clang and GCC extensions are considered part of C or C++, while other compilers aren't.

Didn't say so.

> Refactoring exists for 20 years in Visual Studio with plugins like Visual Assist.

That one is new for me. Didn't know it. Would love to have it not locked to a single proprietary non multi-platform IDE.

> The tools I mentioned as ahead of their time allowed for a Lisp Machines or Smalltalk like experience for C++, respectively.

And they didn't succeed, become popular and were mostly completely unreachable to the sporadic hobbyist.

Re:IKOS: Static analyzer for C/C++ based on the theory of Ab... by jcelerier on Wednesday April 20, 2022 @05:03PM (#31102975)
> Would love to have it not locked to a single proprietary non multi-platform IDE.

https://doc.qt.io/qtcreator/creator-editor-quick-fixes.html

Re:IKOS: Static analyzer for C/C++ based on the theory of Ab... by marcodiego on Wednesday April 20, 2022 @05:16PM (#31103117)
Nice! Thanks!
Re:IKOS: Static analyzer for C/C++ based on the theory of Ab... by pjmlp on Thursday April 21, 2022 @01:23AM (#31106250)
My definition is that being commercial products is completely irrelevant to the fact that the toolings did exist.