|
Quote: I ALWAYS install a different copy of Windows Ditto for me!
Get me coffee and no one gets hurt!
|
|
|
|
|
So, I'm testing some ftp s/w on Windows. Standard code, details deliberately dropped:
handle myHandle = FtpFindFirstFile();
if (NULL != myHandle)
{
do
{
} while (InternetFindNextFile());
}
I'm in the debugger, I just want to see the values in some data structures. Code keeps dropping right out of the do loop. Code steps in, loop exits, I know there are more files matching than just the first... wth is going on?
duh, compiler be too smart - nothing in the do loop, why bother? Add a variable increment in the loop, all works. so much time lost
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Welcome to optimization.
|
|
|
|
|
I have never seen the compiler "optimize" code away in debug mode. That is very curious.
-edit-
That's because optimization is usually disabled in debug builds. I would verify that it is, in fact, disabled.
modified 11-Dec-17 17:54pm.
|
|
|
|
|
optimization is off....
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
charlieg wrote: Add a variable increment in the loop, all works.
Sooo, why shouldn't the compiler optimize it out? You're not doing anything with the next file, and the compiler shouldn't have to know that there is some side-effect effect. To be honest, I'd look at that code and go WTF? myself.
|
|
|
|
|
Marc Clifton wrote: Sooo, why shouldn't the compiler optimize it out? You're not doing anything with the next file, and the compiler shouldn't have to know that there is some side-effect effect. Optimising compilers must be aware of side effects; it's one of the factors that makes optimising REALLY difficult (NP-complete or worse). Optimisation involve producing a semantically equivalent program while minimising or maximising some aspect - run time, memory size, power usage, ...
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
I don't really have an argument with the compiler - with the exception that optimizations are not enabled for the debug target. Since I'm sitting in the debugger, I would have expected the do nothing loop to loop as expected.
I'm making a function call ffs in the control statement. If an optimized build, sure. But I was just knocking around some proof of concept code to understand how all things worked.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
I've seen that many many times. Be sure optimizations are turned off.
|
|
|
|
|
see above. it's a non-optimized debug target.
I'm sure there is some esoteric reason why the C++ compiler is not in error.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Then your assumption that InternetFindNextFile() works as expected must be wrong. Step into it and see what it does.
I have lived with several Zen masters - all of them were cats.
|
|
|
|
|
From a distant point of view, it might as well be a debugger bug (oh, how ironic)...
Or a compiler bug, where turning of optimization doens't turn off optizing away your bit there.
Have you reported the behavior?
I only have a signature in order to let @DalekDave follow my posts.
|
|
|
|
|
Hmmm... seems quite odd, I never saw MSVC remove any code in debug builds.
Could it be a timing issue (helped by your increment, no matter how unlikely)?
Did you check the generated code?
... such stuff as dreams are made on
|
|
|
|
|
Is pasteurize too far to see?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
"Would you like it pastuerised, 'cos pasteurised is best"
"Quite frankly I'd be happy if it came up to my chest"
|
|
|
|
|
'Is name was Ernie, and 'e drove the fastest milkcart in the West!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
And that was the first time that I helped a soldier to desert!
|
|
|
|
|
Oh well here today gone to Maui!
Someone's therapist knows all about you!
|
|
|
|
|
No, that's just the end of your nose.
|
|
|
|
|
You wouldn't dairy get involved with homogenized (I remark sheepishly).
Instead, we curd continue with further cheesy remarks.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Yogurt to butter up on them lest they udderly fail to milk out the laughter you so moovingly seek.
|
|
|
|
|
I do 30 minutes of yogurt every day to make myself more limberger.
If anyone needs some holiday candy canes I have some, not broken either, they're in "mint" condition.
|
|
|
|
|
Had a buddy of mine bring me an almost 10 year old laptop this weekend, that had come with Windows 7, but had been upgraded to 10 back when MS was pushing hard to get people to upgrade. The laptop can do 1600x900, but ever since the 1709 upgrade, his resolution dropped to 1024x768. The only available options in the resolution dropdown were 800x600, 1024x768, and 1152x864.
No amount of fiddling with the video driver, including fully uninstalling and reinstalling it, solved anything. Then I realized something I've never seen before: Device Manager correctly identified the video chipset as a Radeon 3200 HD, but the now-Metrofied (my word) Settings page, where the user gets to choose his resolution, simply reported back "Microsoft Basic Video Display"...or whatever the lowest common denominator is called...as if there was a disconnect between the two. Device Manager reported one thing, but that wasn't brought forward in the resolution selection dialog.
System Restore worked, according to the laptop's owner (restoring to a point in time before installing 1709)--that is, the correct resolution was selected and everything was back to normal...although I didn't see myself while it was back in this state to confirm whether the Metrofied Settings page was then showing the correct chipset name rather than the basic driver. However, as soon as 1709 reinstalled itself a few days later, the problem came back.
As I said, the machine is very old, so it wouldn't surprise me if MS removed support for this particular chipset starting with 1709, and maybe it couldn't figure out what to do with the driver that was already installed/reported back by Device Manager...but that was a rather strange state.
Anyway, long story short: The guy already hated Windows 10, so I suggested to simply reinstall that. A clean install, and at least 12 reboots later (until Windows Update came with nothing else to offer), he was back in business... Bonus: Apparently his hard drive died a few years ago and he had it replaced with an SSD, so even though the machine's quite old, it's still quite fast (especially with a fresh Win7 install).
My point? I had initially set out to describe what a full Windows 7 re-installation process looks like nowadays, but this is already getting way too long, so that'll have to be a story for another day/thread. Suffice it to say that I'm still scratching my head over this disconnect between Device Manager and the Metrofied resolution picker. I dread the day where everything in Control Panel has been "redone". I suspect it'll never happen.
|
|
|
|
|
Microsoft is not alone in lack of support for older hardware. Back in the days of XP I bought a HP scanner that worked great up to the point where I upgraded to Windows 7. The driver was not compatible with 7. I thought: No problem, get a new driver from HP. But HP tech support told me they no longer supported that scanner. It was barely 5 years old. HP's advice: Buy a new scanner!
I took their advice. I bought a Canon scanner and took a solemn oath never to buy HP again.
Get me coffee and no one gets hurt!
modified 11-Dec-17 19:52pm.
|
|
|
|
|
The problem here is that Windows 10 worked fine with that video chipset since the laptop was upgraded from 7 to 10. It's only when 1709 came out that it stopped working. I have no idea whether MS is in the habit of removing older hardware support from updates. Upgrading from 7 to 8 to 8.1 to 10...I can see that happening...but updates to the same OS?
In the past, you could decide to skip an entire generation of Windows until you had tested it sufficiently to determine whether your hardware/software was compatible with it. This new development seems to indicate you can no longer expect compatibility between updates to Windows. That's rather disturbing.
|
|
|
|