lint

Overload Resolution with Two Enums

We have some code that looks roughly like this: // Two enums that differ entirely. enum A { a1, a2 }; enum B { b1, b2 }; // Functions to convert in some meaningful way between them A convert(B); B convert(A); Now, our compiler goes and does exactly what we expect it to. convert(a1) will call B convert(A), and so on. However, when w...

JavaScript Lint inc_dec_within_stmt warning

Can someone explain the reason/importance of why javascriptlint (not jslint) gives the warning inc_dec_within_stmt - increment (++) and decrement (--) operators used as part of greater statement when it comes across a line of code like someValue = count++; Why should I keep this check turned on? ...

in c: func(void) vs. func()

When a C function does not accept any arguments, does it have to be declared/defined with a "void" parameter by the language rules? PC-Lint seems to have problems when there's nothing at all in the argument-list, and I was wondering if it's something in the language syntax that I don't know about. Edit: I just found a duplicate (back-d...

One var per function in JavaScript?

I've been using JSLint to make me feel bad about my JavaScript. It is great, by the way. There is one check that I don't quite understand and I'd like your views, please. From jslint.com: In languages with block scope, it is usually recommended that variables be declared at the site of first use. But because JavaScript does not have bl...

Flex lint (ie, style checker)?

I remember reading about a lint-like tool for Flex code… But I'm having no luck finding it on Google. Can someone point me towards it? Thanks! ...

Where can I find an actively developed lint tool for Ruby?

Most of the code I write is in Ruby, and every once in a while, I make some typo ( which only gets caught after a while ). This can suck when you have your scripts do some long running tasks, and you return to them only to find out you had a typo. Is there an actively developed lint tool for Ruby that could help me overcome this? Would ...

How would one create a Clojure Lint?

One example of a common Clojure programming error is expecting a lazy expression to be evaluated for side-effects. On the surface it appears checking for unused lazy expressions would be helpful. What would be the best approach to identifying this and other common mistakes? Should the core compiler check for these situations, or should i...

splint whole program with a complex build process

I want to run splints whole program analysis on my system. However the system is quite large and different parts are compiled with different compiler defines and include paths. I can see how to convey this information to splint for a single file but I can't figure out how to do it for whole program. Does anyone know a way of doing this? ...

Are there any lint tools for C and C++ that check formatting?

I have a codebase that is touched by many people. While most people make an effort to keep the code nicely formatted (e.g. consistent indentation and use of braces), some don't, and even those that do can't always do it because we all use different editors, so settings like spaces vs. tabs are different. Is there any standard lint tool...

Does anyone have good tips for using pc-lint?

What are some best practices for using pc-lint - how to wade thru the zillion options? I'm particularly interested in better ways to read/parse the output files. ...

PC Lint error linting VS 2008 project files

I'm trying to lint the source files from a VS 2008 project of mine, but although headers files are processed correctly, cpp files are not. Lint process is stopped and this error is shown: #error _WIN32_WINNT settings conflicts with _WIN32_IE setting C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\sdkddkver.h(217) : Error 309:...

Looking for intentionally buggy code snippets

Hey, I'm looking for some database of intentionally buggy code in C++. I want to give a presentation about static code analysis tools, and I want to show some examples in action. ...

Why doesn't lint tell me the line number and nature of the parse error?

I'm calling php lint from a Windows batch file, like so: @echo off for %%f in (*.php) do php -l %%f When a file contains a syntax error, it only outputs Errors parsing xxx.php. Is there any way to get it to tell me what the nature of the error is, and what line it's on? Maybe another switch? ...

Suppressing javascript lint error.

Hi, I'm developing a Firefox extension and I'd like to use Javascript Lint to help me find bugs. However, I keep on getting a "SyntaxError: missing name after . operator" error for the second line: const Cu = Components.utils; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Apparently it's because "import" is a keyword. But it's ...

Gimpel's PC-lint can't trace dangling pointer?

Hi, I've been using PC-lint9 to find out different errors recently and it really blow my mind, but it seems PC-lint9 can't trace dangling pointer, here is snapshot of the code I exam with. int* pkInt = new int; int* pkDangInt = pkInt; delete pkInt; ( *pkDangInt ) = 1; there is no error detected by PC-Lint. I think there may be somet...

I have a JS Lint question

Why do I get these errors? Problem at line 329 character 60: Do not use 'new' for side effects. new widget.StyledDropdown(dojo.byId("sTitle")); Problem at line 330 character 61: Do not use 'new' for side effects. new widget.StyledDropdown(dojo.byId("sSuffix")); Problem at line 336 character 57: Do not use 'new' for side effects. tr...

Which are the best free Visual Studio 2008 plugins?

Hi, I am new to Visual Studio 2008 (not 2010). What do you think are the best free Visual Studio 2008 add-ins or plugins? Is it there some LINT one? Thanks ...

Is there an all purpose lint (-toolkit)?

I want to do a static code analysis on a bunch of scripts written in a not very common programming language (C like syntax). Frequent problems are: the use of not defined/declared symbols wrong number or type of arguments when calling a function The language interpreter/compiler itself does not provide aid for these problems. Is the...

Lint for Objective-C?

Is there any lint tool for Objective-c? ...

How can I check (My)SQL statements for syntactical correctness

Hi all, we're currently setting up out integration server and during that process we've set up pre-commit hooks on the SVN so that our developers can't check in files that are syntactically invalid (primarily PHP and XML). We also have a bunch of .sql files (for MySQL) which I'd like to lint as well. Unfortunately, Google didn't turn u...