| View previous topic :: View next topic |
| Author |
Message |
Colin B Maharaj Guest
|
Posted: Fri Apr 02, 2004 1:23 am Post subject: some kind of preprocessor? |
|
|
Hi All,
Did not know where to post this....but....
Is there a way that I can have the Development Enviromnent call an
external program with the source file as a command line parameter, when
you select 'compile' or 'build'. I am writing a simple tool to check for
certain type of errors in my source (like a tiny lint tool) so I would
not introduce bugs in my code.
|
|
| Back to top |
|
 |
Chris Uzdavinis (TeamB) Guest
|
Posted: Fri Apr 02, 2004 2:04 am Post subject: Re: some kind of preprocessor? |
|
|
Colin B Maharaj <noreply (AT) myhost (DOT) com> writes:
| Quote: | Hi All,
Did not know where to post this....but....
Is there a way that I can have the Development Enviromnent call an
external program with the source file as a command line parameter,
when you select 'compile' or 'build'. I am writing a simple tool to
check for certain type of errors in my source (like a tiny lint tool)
so I would not introduce bugs in my code.
|
The IDE uses the preprocessor as a dll, and doesn't invoke anything
via the command line. So I don't know of any way to intercept the
call in order to invoke your application. You might be able to add a
batch file to your project that runs your checker on your source, but
I'm not sure how that would work.
You'd probably be better off periodically invoking it yourself rather
than having it automatically launched each time you want to compile.
Afterall, compiling takes long enough alredy, and most files haven't
changed and have already been scanned.
--
Chris (TeamB);
|
|
| Back to top |
|
 |
Colin B Maharaj Guest
|
Posted: Fri Apr 02, 2004 9:55 am Post subject: Re: some kind of preprocessor? |
|
|
AH HA! You just gave me an idea. I can hook into the
FileChangeNotification service (I have done this kind of thing before)
and when the compiler saves the file before compilation, I can scan the
file for errors.
Thus my application has to run as a background task monitoring the path
for my project.
Thanks!
| Quote: | and most files haven't changed and have already been scanned.
|
|
|
| Back to top |
|
 |
Eugene Mayevski [SecureBl Guest
|
Posted: Fri Apr 02, 2004 12:32 pm Post subject: Re: some kind of preprocessor? |
|
|
Colin B Maharaj wrote:
| Quote: | Did not know where to post this....but....
Is there a way that I can have the Development Enviromnent call an
external program with the source file as a command line parameter, when
you select 'compile' or 'build'. I am writing a simple tool to check for
certain type of errors in my source (like a tiny lint tool) so I would
not introduce bugs in my code.
|
This should be possible via IDE add-ins. There's seems to be a
possibility to insert your call before actual compilation is done.
--
Eugene Mayevski
EldoS Corp., CTO
Security and networking solutions
http://www.eldos.com
|
|
| Back to top |
|
 |
Chris Uzdavinis (TeamB) Guest
|
Posted: Fri Apr 02, 2004 3:19 pm Post subject: Re: some kind of preprocessor? |
|
|
Colin B Maharaj <noreply (AT) myhost (DOT) com> writes:
| Quote: | AH HA! You just gave me an idea. I can hook into the
FileChangeNotification service (I have done this kind of thing
before) and when the compiler saves the file before compilation, I
can scan the file for errors. Thus my application has to run as a
background task monitoring the path for my project.
|
How often would this occur? While you're editing a file, if the IDE
auto-saves it, would it be scanned? How long does your scanning take?
How well does it work with incomplete source code? While editing
files, they might not be in condition to be scanned....
(Maybe my low opinion about auto-invoked tools is showing
through... I'm too easily annoyed by interruptions and would shut the
auto-invoker off in a hurry. :)
--
Chris (TeamB);
|
|
| Back to top |
|
 |
Colin B Maharaj Guest
|
Posted: Fri Apr 02, 2004 11:31 pm Post subject: Re: some kind of preprocessor? |
|
|
Hey Chris, you know what - you make a good point. However I will still
go ahead with the project cause there is always a compromise to be made
in development. In this case the annoying "popping up" situation is more
tolerable than a customer "popping up" and saying that my product is
buggy and goes on to say that he will tell every business man they know
NOT to purchase my products.
Okey, this has not really happened like this as yet, but you can imagine
what a few access violations can do to a programmers (or software
salesman) reputation - and time.
The guy who I deal with, spent 36 hours straight trying to get an
installation going without success thinking he was doing something wrong.
I then spent about 16 hours or more trying to see if it was a bug - and
it was. These incidents I can do without.
Again my dealer was doing a presentation demonstrating features in our
product. All of a sudden ACCESS VIOLATION!!! He Click Ok and moves onto
the next feature - very embarrassing. Buggy code again.
I am not a perfect coder - no one is - but when you have been burnt once
and twice - and more - boy-oh-boy only the paronoid survives.
Hey Chris, I am not trying to "dis" your opinion, as a matter of fact
thanks for your insight once again - but I will have to be the one to
tolerate an application that can bother the slightly above average Joes
like us, in the Builder Community.
Chris Uzdavinis (TeamB) wrote:
| Quote: | How often would this occur? While you're editing a file, if the IDE
auto-saves it, would it be scanned? How long does your scanning take?
How well does it work with incomplete source code? While editing
files, they might not be in condition to be scanned....
(Maybe my low opinion about auto-invoked tools is showing
through... I'm too easily annoyed by interruptions and would shut the
auto-invoker off in a hurry. :)
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Apr 05, 2004 5:55 pm Post subject: Re: some kind of preprocessor? |
|
|
"Colin B Maharaj" <noreply (AT) myhost (DOT) com> wrote
| Quote: | AH HA! You just gave me an idea. I can hook into
the FileChangeNotification service (I have done this kind
of thing before) and when the compiler saves the file before
compilation, I can scan the file for errors. Thus my application
has to run as a background task monitoring the path for my project.
|
You could also just write an OpenTools plugin that hooks the IDE itself, and
then the IDE will send you notifications during compiling and such.
Gambit
|
|
| Back to top |
|
 |
|