Subj : Re: bcc 5.02 command line v. ide To : borland.public.cpp.borlandcpp From : Ed Mulroy [TeamB] Date : Wed Dec 01 2004 11:58 pm The IDE uses DLL versions of the compiler and linker so does not use the same physical compiler and linker as a command line build. When it generates a make file it does not apply logic to the option settings. Instead it just scrapes its internal bit settings for the options and writes out their command line equivalents. I do not think the C++ option setting have any effect on a C language build EXCEPT for the runtime type id (RTTI) and exception handling (EH). I prefer building from the command line and for C builds I always specify -RT- (RTTI off) and -x- (EH off) as well as linking with noeh?.lib ('?' is 1st letter of memory model) or noeh32.lib to stub out any remaining RTTI and EH found in the libraries. The difference in executable size from doing that is noticable. I also use assembly but use the default mode, not ideal or masm51. When you run under the debugger much of the memory that normally would not be initialized is initialized to zero. Also a small amount of stack space (I think 16 bytes) is used by the debugger. My serial comm ISR's always have a trap bit which detects if the ISR is still active at the beginning of the ISE. If that happens I do the handshake and then IRET immediately. (My ISR's are all assembly - none are written in C.) If your code depends upon specifics of where things are placed into DGROUP with respect to each other you should consider rewriting it to remove such things. That kind of thing is a common source of memory being written to when it shouldn't be. As for make files, I find the IDE-generated ones to be too complex and write my own. If you have an IDE generated make file then a good place to start is to do this to capture what is actually being done without tons of unused macros clouding the picture: make -K -n -f filename.mak >somename.txt and then look in somename.txt for the comands and in make*.* for response file contents (the stuff between the @&&| and the | in the make file). .. Ed > David Morris wrote in message > news:41ae97d8@newsgroups.borland.com... > G'day. > When building does the ide do anything other than use the > equivalent of the make file it generates. In other words > does it call bcc, tasm, tlib and tlink with the same > switches as shown in its generated make file? > > Does it ignore any of your settings in favour of its own! > If not (as I would expect), why does it still export all > those individual warning switches when you have turned > them all off (or on)in the IDE? I can't find a setting > that removes the warnings (for clarity). (I have assumed > that -w turns on ALL warnings in the command line). > > When I work my way through the 'IDE generated' make file > most of the switches are redundant (and I had to reference > old manuals to recognise -Os), but I think I end up with > the same effective result (well at least the same file > length). Is there anything I should know about IDE and > command line differences? > > Do any of the C++ command line switches have any bearing > on pure 'c' compilation? > > Thank you for just reading this far! > > regards DM > > ***************************** > Back ground: > I am building a 'hand coded' make file for the 16 bit part > of a large project currently in the Borland C++ 5.02 IDE. > I love the old IDE, but the file is so big now I feel that > it is unsafe. > > The code base is considerable, and includes pure 'c' and > assembler. The assembler files are mixed IDEAL and MASM51 > modes, but are compiled with TASM 4.1. The code and even > the make files are so big that it would not be sensible to > post them here, but I have a 'sort of' example below. > > When compiled from the IDE the (main) program 'seems' to > work correctly. From the hand coded make file, there > appears to be a problem with part of a data address being > overwritten during program execution... a buffer overrun > in other words, but this only occurs occasionally. I > think I have proved this by placing a buffer space of > about 8 K in front of the area in question (not a fix, > just a proof). Now I think it is quiet possible that the > buffer overrun is in the code somewhere, and that order of > link has changed the layout of DGROUP. > > However, this might not be the only cause. One > possibility is that an interrupt driven serial port > function which updates the address of the buffer is being > interrupted mid update as it were, and this buffer just > happens to be 8k long. But why this would not occur in > the IDE generated code mystifies me (I added some cli and > sti statements to hopefully eliminate this). > > I am mentioning all this, because on want to focus on > eliminating one area from my enquires, the difference > between my make file and the IDE's. > > ****************************** > Sort of example for BCC: > > Deconstructed typical IDE command line switches in order > including the cfg file: > > -W- -w -R -v -vi -H -H= -N -Ff=5000 -i55 -ml -w-use > -w-stv -w-cln -w-sig -w-uc p -w-bbf -w-pin -w-nak -w-def > -w-nod -w-amb -w-asm -w-amp -w-obs -w-pch -1- -w- inl > -w-lin -w-lvc -fp -v- -R- -x- -xd- -xp- -RT- -X -Od -w-cpt > -w-rpt -w-rng -w -voi -w-ret -w-sus -w-stu -w-dup -w-big > -w-ext -w-dpu -w-zdi -w-bei -w-obi -w-o fp -w-nci -whid- > -w-ncf -w-mpc -w-mpd -w-ntd -w-nvf -w-hch -w-pia -w-pro > -w-rvl -w-aus -w-par -w-rch -w-eff -w-ill -w-ias -w-msg -w > -H- > > -N -H= -ml -Ff -x- -Os -w-cln -w-sig -w-ucp -w-pin -w-nak > -w-pre -w-def -w-nod -w-amb -w-use -w-stv -w-rch -w-asm > -w-pch -w-bbf -k -O-c -Z- -O- -O-e -O-l -O- b -O-W -Od > -O-a -Ff=5000 -i55 -O-m -O-p -O-v -d- -O-i -v- -R- -w-amp > -w-obs -1- -a- -fp -Fc- -dc -xd- -RT- -X -w-ill -w-ias > -w-msg -w-aus -w-par -w-eff -w-pia -w-pro -w-rvl -w-inl > -w-lin -w-lvc -w-nci -whid- -w-ncf -w-mpc -w-mpd -w-ntd - > w-nvf -w-hch -w-obi -w-ofp -w-voi -w-ret -w-sus -w-stu > -w-dup -w-big -w-ext -w- dpu -w-zdi -w-bei -w-cpt -w-rpt > -w-rng -w -H- > > -R- -w -N -vi -Ff -r- -v- -1- -a- -fp -dc -y- -k -Ff=5000 > -O- -O-l -O-b -ml -f -x- -xp- -xd- -xc- -xf- -RT- > > -ml -1- -w > > -c -Tde > > And mine: > > -P- -c -b- -v- -d- -f -fp -X -u -i55 -A- -k -H- > -1- -a- -p- -ml -dc -Ff=5000 -w -w! -w-msg -Fs- .