- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Oops, I messed up the [quote] tag.
Admin
It used to be common to do something very much like this in the old 8-bit Atari BASIC, though for completely different reasons.
In that version of BASIC, all numbers were floats and took six bytes to store. But variables only took two bytes. So if you were really crunched for memory, you'd convert all your most-common numeric literals to variables and use those instead. So your program would start with someting like:
10 N0=0:N1=1:N2=N1+N1:N3=N2+N1:N10=10:N256=256
You could easily free up a kilobyte or more this way, which was significant when you only had 32 of them to play with!
Admin
That is awesome and terrible.
Thank you, sir. You've just made my day.
Visual Studio 6 is the only version that doesn't insert .net dependencies whether you're using them or not.
Admin
BS. We used 7.1 (and now 8) to produce c++ code that ran fine on vanilla Win98 boxes.
Admin
OMG, didn't you know they're up to V7.3 of the compilers now?
Get with the times, man! :-)BTW, what's with the extra newlines when I use the code tag? It kind of defeats the purpose of the tag, unless I'm not using it right, or the bug is only in preview? At least in this case it makes it a little easier to read...
Admin
Oops, my bad, the latest VAX C++ compiler is V5.6C.
Admin
#define HMI_PI (float)3.0F // I Kings 7:23
Admin
When I tried the example, I get a compiler warning :
WARNING: HMI_WTF undefined
Admin
couldnt have said it better with a sharpened axe and a sledgehammer. Laziness is an excuse, no a disguise for incompetence
Admin
Actually, I'm infatuated with consultants. I even want to have their babies (but I'm not going to tell you what for).
Isn't it just the slightest bit possible that the people who write compilers (with warnings, and all) aren't your typical programmers, let alone consultants?
Or am I just being presumptuous in calling you a dipstick?
Admin
What are you, some sort of goddamn Access programmer?
Admin
Not bad in and of itself.
However, I noticed the same problem myself, around eight years ago. The overnight build was spewing out an incredible number of warnings, some of which were quite serious ("Warning: this object may not be fully constructed").
I wrote some sort of script -- I forget what,, but it was probably ksh -- to filter this down to what I thought were the potentially fatal errors, and passed the results on to management.
Their response?
"Why are you bothering us with this?"
Why, indeed.
Admin
I take offense to your labeling "whatever rules Microsoft makes up this quarter" as "standards".
Admin
Oh for the joy of being allowed to upgrade.
I am maintaining code written fifteen to twenty years ago. Most of it is in FORTRAN. My previous job was cutting-edge: I was at an HP workshop when VMS for Itanium came out, to get the code working, and went through another wave to have our product V8.3-compatible as soon as it was released. But here everything is frozen in time, and dangerous innovations like source-code-control software are de facto forbidden.
And we're hiring! Apply now!
Admin
I just checked and 0.4f turned out to be approximately 0.400000006, to which 0.40000001f is even closer, so it should come as no surprise that it is actually the SAME value as 0.4f.
(This was GNU C++ on Solaris / SPARC, curiously in both the 32-bit and 64-bit incarnations of the compiled test program. Your mileage may very.)
Admin
captcha: acsi Usage: I acsi you to learn how to code, but you do not listen.
Admin
Now back to the topic at hand: we upgraded our compiler to vs8, and received [naturally] tons of warnings. We sent it offshore to fix the warnings at the same time as other necessary changes were made. What we get back was:
#pragma warning(disable:x)
Over and over again...
captcha: feugiat usage: feugiat him, hold him still so I can take a whack.
Admin
Admin
oops, that should have ended:
obviously...
Admin
By the way, float(1.0) is valid C++. Writing a macro like FLOAT(1.0) isn't necessary.
Admin
Enjoy.
Admin
Which is unfortunate since VC6 does have real problems and bad compiler bugs, which just have to be worked around given the lack of a good alternative.
Admin