- Feature Articles
-
CodeSOD
- Most Recent Articles
- What a More And
- Hall of Mirrors
- Magical Bytes
- Contact Us
- Plugin Acrobatics
- Recursive Search
- Objectified
- Secondary Waits
- 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
((price*)null)->getDellDiscount();
Admin
UFO is a German union. That's just their name. Although the pun mught be intentional.
Admin
UFO (Unabhängige Flugbegleiter Organisation) is the name of Lufthansa's flight attendants' union. The statement still sounds funny, almost like an intended pun.
Admin
Access violation: Dereferenced Null-Pointer
Admin
discountProviderFactoryRepo.getProvider().factoryForProducts([](x) -> x != (product*)(86 - 86)).setOnSale();
Admin
Nothing to do with French, somewhere deep in the archives I have a screenshot from a popup in Windows 98 (either OS or maybe a zip util) saying, "Error: The operation was a success."
Admin
I never trust the French with my exceptions either.
Admin
This is part of the plan for getting back at Quebec for being a jerk to English people.
Admin
I definitely wouldn't. Google Play Music can usually handle playing music files, but it sucks at managing pretty much anything, like playlists.
Admin
Does not compile. C++ Lambdas require {} pairs around the function itself and java or C# don't use Pointers
Admin
Rendez-vous. Toute résistance est inutile. Préparez-vous à être assimilés.
Admin
I happened to get caught up in a Lufthansa Warnstreik a few years back. I hope Pedro was able to make alternate arrangments.
Admin
If you look at the capitalization, it makes sense. Google Play Music wants access to Google Play music library, not to Google Play Music library
Admin
The operation succeeded.... but the patient died.
Admin
To be clear, C# does use pointers. It uses them a lot. It just forces the person writing the program not to use them, unless they are willing to mark their code "unsafe", in which case they can do whatever they want.
Admin
"Adrien wrote, "The exception L'opération a réussi (Operation succeeded) being thrown leads me to believe there is nothing wrong here and this application is simply intolerant of the French language"
Nah, Microsoft stuff does this all the time even with English. The classic 'Operation Failed: Success' error dialog is older than the WTF blog is.
This happens whenever something sets the error flag but doesn't set the error code. When displaying the message, you call the method that turns the error code into the error string, and since it's 0 you get 'Success' in English or 'réussi' in French.
Admin
I thought a common way that could happen is:
An I/O operation encounters an error, so it sets a global variable ("errno") indicating the specific error condition and returns a flag saying there was an error.
The returned flag being set causes the mechanism for showing the error message to start running.
Another I/O operation sneaks in (perhaps as part of step 2 or perhaps in another thread of execution) and succeeds, which sets the global error code back to "no error"
The mechanism for showing the error reads global error code and displays the contents (Operation succeeded).
Admin
Having “success” for a default error code is a very bad idea. Even “unspecified” would be better, if an error occurs but the programmer forgot to set an error code.
Admin
So that developers would have to explicitly set an error code of "Success" when their code completes without an error.
Admin
That's a good idea anyway. That said, some functions will deliberately and usefully set a non-success last-error state even when they succeed.
The example that springs to my mind is the Win32
CreateMutex
call for a named mutex. If a mutex by that name already exists,CreateMutex
will return a handle to it, but also set the Windows equivalent oferrno
toERROR_ALREADY_EXISTS
. The docs don't say what value is used ifCreateMutex
had to create the mutex, but I'd put money on it beingERROR_SUCCESS
, to protect against the case where the "last error" was alreadyERROR_ALREADY_EXISTS
.Admin
This is why it's a better idea not to return an error flag and an error number, but just solely an error number, and the error number being zero is itself an indicator of 'no error'. Otherwise you get exactly this problem of a caller checking the error flag, seeing it set, and then attempting to report errormessage[0] as an error.
if(result=do_thing()) report_error(result); sorta thing
Admin
C# has a different lambda operator so it isn't C#. C# uses => instead of ->
Admin
Good catch that UFO is a union. I can also sympathize with the admin Dan article… I figure something like this may have happened:
Just an hypothesis, of course, and still a WTF on multiple levels (for one, application of the "protoduction" process anti-pattern), but at least there is a possibility that whatever happened is half-way understandable to someone knowing the details.
Admin
Oh, this is all a bad idea, especially the bit about having a global variable for the error code. Besides people not setting it properly, as Simon Clarkstone pointed out this means something on another thread/task can blithely overwrite your real error. But that's how they did things back in 1990.
Admin
Geeze Louise. Cue the Braniff plane! I can't believe some of these comments. errno has been thread-local—not even a plain variable—for ages now on real OSes, long before C++11 mandated its safety. And $err (VS debugger pseudovariable notation) has always been, of course.
Whenever I saw 'Whoa, error! The operation completed successfully.' back in the day, I always imagined some reusable error handler had indirectly SetLastError() before the query.