Re: MSVC and GCC compilation warnings
Gé Weijers <[email protected]> Thu, 30 Apr 2026 09:34:10 -0700
| Newsgroups | gmane.comp.lang.lua.general |
|---|---|
| Message-ID | <CAGj8pri_HuAjy8aPzSP+qfXkZk4iWSsGS4fT==NbP_JCTa4dYA@mail.gmail.com> |
On Thu, Apr 30, 2026 at 8:24 AM Roberto Ierusalimschy < [email protected]> wrote: > > Can anyone explain this warning? The recursive call is guarded by two > if's, and it calls the function with a different argument (L in the > original call, mainth in the recursive call). How can the compiler decide > that the recursion is infinite? > In my last job I used a commercial static analysis tool which was far more sophisticated than what you find in compilers, and it produced false positives by the truckload. The good thing about it was that it had a database in which you could permanently mark a warning as a false positive. The compiler is just not 'smart' enough to figure out all cases (you'd need to solve the halting problem to do that), and if in doubt it gives a warning. There are ways to put pragmas in the code to suppress the warning, but they're compiler specific and not that useful for portable code like PUC Lua. -- Gé -- You received this message because you are subscribed to the Google Groups "lua-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/lua-l/CAGj8pri_HuAjy8aPzSP%2BqfXkZk4iWSsGS4fT%3D%3DNbP_JCTa4dYA%40mail.gmail.com.