User forums > Using Code::Blocks

Code::Blocks and lint

(1/3) > >>

Lazybones:
Hi there.

I have to integrate lint in our build process, preferably as own target because we have to invoke lint for each source file to check for possible errors before building it.

Is it possible to integrate lint as a "pseudo-compiler", which I then invoke in an own target? The problem is, that the linking step must not be done, because only the source files should be checked and then the process should be stopped. So, is it possible to define a new compiler (either in CB source and recompile CB, or directly in CB's compiler settings) and leave the linker command empty?

Any help is appreciated!
Thanks
 Sven

MortenMacFly:

--- Quote from: Lazybones on January 07, 2008, 10:10:21 am ---Is it possible to integrate lint as a "pseudo-compiler", which I then invoke in an own target?

--- End quote ---
I had done similar recently. I solved it by actually making a copy of the GCC compiler and exchanging the executables with batch files that call lint (or any other preprocessor you like) before and throw an error if that fails. If it succeeds they just call the compiler with the usual command line. But you probably need to write a tiny app that extracts the file from the compiler command line.
Then I created a target (pre-compiler) that uses only the files I want to check and this "pre-compiler". This works very well and C::B will stop compiling if the batch file returns an error (as it thinks the compiler has thrown the error).

Another way is to use scripting and integrate lint into the pre-build process. You can use the per-file variables for each compilation step if you like.

Another possibility is to write a plugin that does that accordingly - this should actually be very easy and could possibly be a scipted plugin.

You see - plenty of possibilities - just choose one. ;-)

With regards, Morten.

Bonanza:
Hi Morten,

It sounds very interesting what you did with the batch jobs.

Are there any possibility that you could share then?

Regards Flemming

tilmannreh:
Well, I know that this is a really OLD thread, but...

I would like to integrate LINT (current version is 9.00L) for usage in Code::Blocks (16.0.1).
Any concrete advices, tips, or a recipe how to do that?
(I don't like reinventing the wheel...)

Thanks,
Tilmann

oBFusCATed:
Probably check the valgrind plugin or something similar.
How is lint given the files to parse?

Navigation

[0] Message Index

[#] Next page

Go to full version