--------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00021 Date: 01/25/98 From: FRED COLE Time: 12:07pm \/To: NEIL HELLER (Read 0 times) Subj: WARNING MESSAGE - 2 Neil Heller of 1:161/204@fidonet.org said to Darin Mcbride: DM> #define NOTUSED(x) x DM> void rc_select_slave(HANDLE h, LPSTR r) DM> { DM> NOTUSED(h); DM> NOTUSED(r); DM> error_message(NULL, "Not here"); DM> } DM> Most compilers will merely optimize away the first two lines DM> there, but not until after figuring out that h and r are in use. NH> Very clever, I'll try it... however wouldn't it be an error (after NH> macro expansion) to write NH> void rc_select_slave(HANDLE h, LPSTR r) NH> { NH> 0441:7798; NH> "For whom the bell tolls"; NH> error_message(NULL, "not here"); NH> } NH> It seems to me that the compiler would croak on the first two lines of NH> code. No, it would translate to: { h; r; which would be ignored. However, if that bothers you could do this instead: { h=h; r=r; which would amount to the same thing for any reasonable compiler -- optimized away. --- msged 2.08d * Origin: Yell fore, take 5, write down 3 (1:231/50.4@fidonet.org) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00022 Date: 01/27/98 From: BOB STOUT Time: 01:58am \/To: ANTHONY TIBBS (Read 0 times) Subj: Finite State Machine - Extensions [1/3] Anthony... Message 2/3 never made it here. Please repost. --- QM v1.00 * Origin: MicroFirm : Down to the C in chips (1:106/2000.6) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00023 Date: 01/27/98 From: BOB STOUT Time: 02:03am \/To: DAVE KELLY (Read 0 times) Subj: Help Needed Dave... The find first/next functions exist in DOS and its decendants. Although the implementations in DOS, Win32, and OS/2 are similar in many respects, details differ. In order to make everything portable between familial OS's and various compilers, DIRPORT.H in SNIPPETS was invented. Perusing it should reveal a lot about how the underlying system calls work. --- QM v1.00 * Origin: MicroFirm : Down to the C in chips (1:106/2000.6) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00024 Date: 01/25/98 From: AUKE REITSMA Time: 10:23pm \/To: DARIN MCBRIDE (Read 0 times) Subj: Moderator nominations Hi Darin, On 23 Jan 98, 18:19, you wrote to Auke Reitsma AR>> _YOU_ are noted as 'hesitant' ;-) DM> I know that much. :-) DM> How's this: I vote for the status quo. DM> Assertive enough? OK. I'll change your vote to 'Opposed'. ;-) Greetings from _____ /_|__| Auke Reitsma, Delft, The Netherlands. / | \ -------------------------------------- --- GEcho 1.00 * Origin: Home by the C (Auke.Reitsma@net.hcc.nl) (2:281/400.20) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1X00000 Date: 01/27/98 From: DAVID J PORTER Time: 04:15pm \/To: KURT KUZBA (Read 0 times) Subj: Pointer to a string Kurt Kuzba, In a message on 25 January, you wrote to me : DJ> Are there any true 'string' libraries available for C? KK> You can do this quite easily. The secret to BASIC strings KK> is that the strings are handled in a single, preallocated KK> memory block which is managed by the support code. KK> All the same standard functions are used, and garbage KK> collection is performed as needed. I thought as much. The garbage collection could be a major stumbling block as I am not exactly up on the play when it comes to them [I've only just become comfortable with dynamic allocation without getting into any thing too fancy!] KK> The drawbacks are obvious, however. KK> You have only the specified string space, usually just KK> under 64K, to the limit of a standard malloc(), and you KK> lose some speed due to your garbage collection. But what would the trade-off be WRT speed versus memory fragmentation. As I would understand it, there would be a lot of small malloc/free calls which would tend to cause at least a small amount of fragmentation. KK> You save some time because you aren't allocating on every KK> string initialization, but in the long run, it is easier KK> and faster to just use the standard string.h functions. KK> Once you learn their use, they are much more powerful and KK> not really very difficult to use, compared to BASIC. I will probably use these and forget about the single string block, with additional functions added to cover those that are missing (or at least some wrappers around the more esoteric ones). KK> There are MID, LEFT, RIGHT, and other BASIC-like functions KK> in the SNIPPETS collection. I only have the 10/95 SNIPPETS collection, and it appears that I won't be in a position to upgrade to the later ones for some time. But the versions contained in there look suitably robust enough to be useful, although I'll admit that I have yet to use them in anger. KK> The simple fact is that you just don't find many greyhound KK> buses out in 4x4 territory, but they really aren't missed. I like it. I even copied it into my quotes file. Cheers, DJP ... * ATP/Linux 1.42 * To live in the hearts we leave behind, is not to die. --- Maximus 3.01 * Origin: The Farm - Christchurch, NZ, +64-3-385-4750 (3:770/255) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1X00001 Date: 01/27/98 From: DAVID J PORTER Time: 04:21pm \/To: SUNIR SHAH (Read 0 times) Subj: Echo reunification Sunir Shah, In a message on 25 January, to Auke Reitsma, wrote : AR> The standard will evolve ... not fade out. Whether C will AR> be used much in the future remains to be seen ;-) SS> Well, thirty years is a good track record, but I fail to see C being acti SS> used in anything but year 2038 programming after a few decades. It's not going to be that clear cut, and I wouldn't want to step out on a limb and predict a date. Just look at all the code that still survives in languages that have been all but written off. [COBOL springs readily to mind, although FORTRAN isn't too far behind.] TC> ... C++. Guess sooner or later, we will have to get used to it. AR> We will. I still see a future for at least the length of my [hopefully] employable life for competent C programmers, even if only in a maintenance capacity. SS> In the latest DDJ's letter basket someone called C++ Ada for the 90's. SS> I laughed. I'm still laughing! I once had a play with an Ada system, and that was enough. There was something in there for everyone, or, I think everyone was allowed to put there favorite programming feature in. But it still couldn't make a decent cup of tea! SS> OTOH, I've become a C++ convert, somewhat. Since it's apparently been SS> ratified or frozen for the time being, maybe it's time to read the SS> specification. Or I could just go out and get drunk; same effect. ;) Not quite. C++ hangovers can last months and months.... Cheers, DJP ... * ATP/Linux 1.42 * Here I run, to steal the secret of the sun. --- Maximus 3.01 * Origin: The Farm - Christchurch, NZ, +64-3-385-4750 (3:770/255) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1X00002 Date: 01/27/98 From: KURT KUZBA Time: 11:56am \/To: SUNIR SHAH (Read 0 times) Subj: Free(question) SS> Since when was memory automagically freed upon exit? DOS programs, for one example, will free(), on exit, all memory allocated during program execution. You don't want to try this in a Windows program, though. Windows will maintain that allocation until it is terminated. Terminating Windows will release the memory though. Under Win'95 or WinNT, you never leave the GUI, so those resources are just wasted forever after until you reboot the system. The compiler will warn you about it during debugging, if you debug your code, and clean up after you, but release code will not. > ] Tagline not responding Accept, Reject, Flame........ --- * Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1X00003 Date: 01/27/98 From: CARLTON WALTERS Time: 05:51pm \/To: ALL (Read 0 times) Subj: i got another simple question the question is if i use typedef enum { jan, feb ,mar etc } mytype; what i am trying to say is does typedef realy create a new data type, or as i think just rename it. I know in c++ when you use classes you create new data types. and also I tried compiling a program under ansi c. i used void main() the compiler told me main return type has to be an int i know in c++ it can be any type i want including void. is this part of the ansi c stantard that main return type must be int. or is it something i set wrong in my compiler, which i don't think so, because when i change it to c++ it complied ok. --- FastEcho 1.46 * Origin: House of Fire BBS - Toronto - (416)601-0085 - v.34 (1:250/536) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1X00004 Date: 01/25/98 From: ROGER SCUDDER Time: 11:41pm \/To: AUKE REITSMA (Read 0 times) Subj: WARNING MESSAGE - 2 Hello Auke. 19 Jan 98 19:56, Auke Reitsma wrote to Neil Heller: NH>> The two warning messages I get are that neither hwnd_rec nor rid NH>> are referenced in the function. AR> pragma. In all cases it is compiler-specific. Borland uses both "#pragma AR> argsused" and "#pragma warn -par". I think that this must be placed just FYI, MSVC++ also accepts #pragma argsused -Roger ... I am Bugs Bunny of Borg. What's up, Collective? --- Msged 4.20 beta 3 * Origin: Hodge-Podge Support BBS, Upper Darby, Pennsylvania, USA (1:273/404@fidonet)