Letters to the editor may be sent via email to cujed@cmp.com, or via the postal service to Letters to the Editor, C/C++ Users Journal, 1601 W. 23rd St., Ste 200, Lawrence, KS 66046-2700.
Dear Sir,
At first I quite enjoyed the article A C/C++ Comment Macro in the January 2001 issue; this macro appeared to solve a problem that Id been thinking about for some time. Upon further review however, its clear that the proposed solution is highly nonstandard, and fails to work as advertised on any recent variant of GNU/g++, as well as the Sun WSPro C++ compiler on Solaris.
To recap the solution presented, the C preprocessor expands a set of two macros, which result in the generation of the C++ comment token (//) when using release mode, and results in an empty string when using debug mode. A quick check of the C++ Standard (ISO/IEC 14882:1998) shows clearly that this solution cannot work unless the compiler is a nonstandard implementation. Paragraph 2.1 (Phases of execution) mandates that comment removal occurs in phase 3 of the preprocessor, while macro expansion occurs in phase 4. For the solution presented to work as advertised, these phases must be done in reverse order.
To Mr. Timperleys credit, I was able to recreate his results using Microsoft Visual C++, version 6.0. This shows that the folks at Microsoft arent too keen on following standards and helping insure portable code.
Are you perhaps considering changing the title of the magazine to Microsoft C/C++ Users Journal?
George F. Riley
riley@cc.gatech.eduWell, there already was another magazine devoted to Nonstandard C++, but it folded about a month ago. We would rather not go there. Thanks for writing. mb
Dear CUJ,
That was a wonderful article on the gdb debugger by Randy Zack in the February 2001 issue. Encore!
Steven Ellis
Hi!
In your February 2001 edition, the article on emulating exceptions in C proposes a macro that writes the current filename and line number to a log, in order to track where the problem arose.
Great, but wouldnt it be far more efficient (in space) to simply write the program counter, and then use addr2line on the host system to work back? Its not quite so portable (theres no easy machine-independant way that I know of to get the program counter) and relies on having a matching image on your host system, but you would save lots of space.
For extra points you could crawl the stack frame to work out the backtrace and not bother writing the program counter at all.
Regards!
Luke Diamand
Dear CUJ,
I quite enjoyed reading the article Debugging under GNU/Linux by Randy Zack in the February 2001 issue. However, it contains a few remarks that caught my attention as being entirely wrong. All these relate to debugging facilities available on Windows. (For some reason Linux developers make quite a habit of denouncing Windows whenever they write about anything.)
To correct the author:
1) Windows NT has Dr. Watson logs which provide capability of postmortem examination similar to Unix core dumps.
2) When debugging under VC you can call any reasonable function you like just like the author described for gdb. Simply write a function call in the watch window, hit Enter and it will execute. For details consult the excellent book Debugging Applications by John Robbins.
Thanks,
Eugene Gershnik
Development Leader Computer Associates
eugene.gershnik@ca.comDear Sir,
In response to Mr Weavers letter of the February 2001 edition of CUJ, I feel an urge to point out the hypocrisy of his statements. Whilst I agree almost entirely with the content of the letter, and feel that computers may have played an exacerbatory part in the bastardisation of the English language, I feel the greater part has been played by those who purport to be speaking (or writing) proper English, whilst failing to use it correctly.
Perhaps the likes of Microsoft with its U.S. English, have played a larger part than I give credit for, but I feel they were simply following the American mindset, that had already changed the spellings of colour, and vapour, with or without the ize.
And now you have the gall to complain that the English language is being abused?
Sincerely,
Charlie Stott
Gold Coast, AustraliaI had briefly considered apologiz(s)ing on behalf of my American forebears for dropping those precious us from vapor and color, but I am fresh out of five-syllable words. So I guess I will just wish you a nice day. mb
Marc,
Two comments on your Drowning Big Brother editorial.
One, in Sydney, Australia there are two types of taxi cabs. Those with digital cameras and those with plexiglass shells in the interior of the automobile surrounding the driver. Both are designed for driver protection. The taxi drivers my wife and I spoke with stated they prefer the cameras if they can afford it.
Two, your suggestion that we drown the old boy in data has been around for some time now. I cant recall what version of GNU emacs first introduced the spook command.
The interactive help states:
spook: an interactive autoloaded Lisp function. Adds that special touch of class to your outgoing mail.
Example output:
munitions Honduras SEAL Team 6 smuggle NSA BATF Clinton Peking AK-47 Noriega Cocaine $400 million in gold bullion DES Saddam Hussein [Hello to all my fans in domestic surveillance]
We can safely assume this email is now safely stored in a taxpayer funded carnivore database on a stage 3 power grid.
Regards,
Michael R. MacFaden
San Jose, CAMr. Briand,
In your editorial noting the massive, intrusive and various collection of our personal data, near the end you say ... fill out every survey that comes your way, and if you happen to screw up the facts, well hey, you know, life is short.
Ive had the same thought in a slightly different context.
In exactly the same vein as your editorial, let me suggest that it should be very hard to say which way you voted when confronted with an exit poll. I would hope that if enough voters adopted this idea (and shared it with all their friends and neighbors), it might be possible to get through an election without having to listen to various networks telling us who won.
Frank Griswold
Corvallis, ORWell, I can understand your being weary of election coverage in the media, but I kind of like exit polls. Seeing how close this last presidential election was, I think it is good to have some way to determine how people voted especially when Florida cant.
On another note, my editorial was admittedly tongue-in-cheek; in my heart of hearts all this surveillance and data gathering scares the hell out of me, and maybe it should scare the hell out of all of us. I dont really know if a grassroots misinformation campaign would be effective against Big Brother. At any rate, I advocate such a campaign only against organizations that dont deserve to know anything. Unfortunately, there are quite a few of those around.
Thanks for writing mb.
Dear CUJ,
In response to the query about books on NMAKE and Makefiles in the letters column of the March 2001 issue: GNU Make, from the Free Software Foundation, and Managing Projects with Make from OReilly Books are very useful. The latter has a couple of pages on NMAKE.
Tom Steger
tsteger@granite.comDear CUJ,
In the March 2001 issue, Mr. Medina requested recommendations of books about Makefiles and NMAKE. An excellent reference is Managing Projects with Make by Andrew Oram and Steve Talbott, published by OReilly & Associates (ISBN 0-937175-90-0). This book really cleared things up for me!
Scott Killen
Greetings,
I just read Mr. Medinas question in the March 2000 issue, and it reminded me very much of the situation when I started developing my own make files. The only good reference I was ever able to find, sadly, was Microsofts Environment and Tools reference book that came with an out of date version of Microsoft Visual C++, perhaps as old as the 16-bit v1.52 release. I say sadly because the E & T book devoted much space to reference and little to explanation.
At any rate, I became somewhat of an expert on makefiles at the company where I was working at the time (c. 1994) largely through trial and error and study of that one book. If Mr. Medina has any specific questions, he can always send me email. I keep meaning to write an article for a journal one of these days on the amazing things one can do with makefiles, but none of the journals Ive approached seem interested. Hope this helps!
John Williston
Consulting
http://home.zyan.com/~wc
wc@zyan.comUnless our database is in error, you have never approached us about writing such an article. We might actually be interested if you can keep it fairly non-platform-specific but concrete at the same time (which is tough, of course). Thanks for writing. mb
The following letter is in response to a Special Request that appeared in CUJ asking for essays on Hungarian Notation and related schemes.
Dear CUJ,
I dont promote Hungarian Notation here, since the notation was primarily intended to annotate the type of a variable (e.g., wCount, szName, etc.).
My main objection stems from tying the type of a variable to its name. This implies that any modification to the type requires a corresponding modification to the name (e.g., wCount to dwCount when the type is changed from WORD to DWORD).
Whilst I dont promote Hungarian Notation, I am in favour of adorning the names used in programs with the role played by that name (e.g., a typedef, a class, a #define, an enum, etc.) and giving information about the location and scope of the name. I see this as subtly different from the intent of Hungarian Notation.
Consider the following:
speed = distance / time;I cannot deduce much from these names. Whereas:
mSpeed = gDistance / XYZ_TIME;will tell me that:
- mSpeed is a member variable of this class
- gDistance is a file-scoped variable in this implementation unit
- XYZ_TIME is a #define specified in the xyz component
Earl Chew
You know, of course, there are some folks who think any kind of decoration at all is evil. I wouldnt go that far. In fact, I just thought up another possible reason to decorate names: to distinguish between owning pointers (pointers held by functions or objects that are responsible for freeing the memory when they are done with it) and non-owning pointers. Ive been doing a lot of work with third-party graphics libraries lately, and these ownership issues are driving me nuts. Some of the libraries free the memory they allocate; some dont hmmm, this may be the beginnings of another special request ... anyway, thanks for writing. mb