You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Chris mentioned he was producing a version of EZGUI (DDT edition) that removed all of the irrelevent guff from the code.
With a posting like the one in the Source Code forum, it is difficult to see what the example EZGUI code is doing because the "meat" of the code is not easy to spot amongst the bulk.
Speaking of guff removal, has anyone ever built a PB garbage collector to detect/strip unused vars, functions etc? i notice some compilers such as lcc alert you to unused funcs/vars etc when you compile, is that going to be a feature of the next PB compiler?
[This message has been edited by Wayne Diamond (edited July 15, 2001).]
but somehow greg turgeron (?) pointed another (actually much comfortable) way:
to start dbgview (www.sysinternals.com) and to use outputdebugstring in pb/dll.
That is interesting. DbgView is a nice application the
only thing I dislike is that if I want to release a debug
version for testing on another PC then that PC will have to
download DbgView. I like the ability to have all the
debug code inbedded in my app.
Originally posted by Wayne Diamond:
Speaking of guff removal, has anyone ever built a PB garbage collector to detect/strip unused vars, functions etc? i notice some compilers such as lcc alert you to unused funcs/vars etc when you compile, is that going to be a feature of the next PB compiler?
There are no current plans for the compiler to remove unused Subs and Functions, as it is not always possible for the compiler to tell whether you may call these "unused" functions from outside of the application. To be safe, the compiler includes all such subs/functions in the compiled code.
Originally posted by Wayne Diamond: Speaking of guff removal, has anyone ever built a PB garbage collector to detect/strip unused vars, functions etc? i notice some compilers such as lcc alert you to unused funcs/vars etc when you compile, is that going to be a feature of the next PB compiler?
Wayne,
I'm writing a program that can remove unused functions and subs of a source file.
I stopped programming on it for a while to work on another program, but
the 'stripper' as I call it is already partially working. The only thing
I have to program is for the program to handle search paths of include files.
Also tooltips and help files have to be written.
The program checks the source code and lists all of the unreferenced subs
and functions. Of this list you can select which subs you want to remove and
which you want to keep in your program. The cleaned up code is saved
under another name.
If you want I can e-mail you the source code 'as is' so you can use
it to clean up some of your code or even to finish the program..
Kind regards
Eddy
Lance, i have absolutely no idea how pb.exe goes from source to exe but I would have thought that it might be able to keep count of how many times each sub/variable is used (but ignoring exported functions!), and then at the end of the compile if any subs/vars have 0 references, a simple alert letting the user know that the sub/var wasnt referenced... ? It just seems to me that garbage detection is best done by the compiler itself?
Eddy, I just sent you an email, Id love to see your source thanks im not so much interested in garbage removal/stripping as I hate automated deletion of anything, but detection would be superb. Im tempted to write my own also
i already did knuth, some time ago, but xref only creates a report
and i want the actual removing of unreferenced subs. i managed to do this
in my program, but it needs a bit of work to finish.
eddy
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment