Think of interesting bugs from a Microsoft

zhaozj2021-02-16  45

I found a very interesting bug of Microsoft these two days. It is interesting because this bug does not exist in the program, but exists in the header file.

The phenomenon of this bug is this:

If you have the following content in your project:

#include

Then your project is compiled, and there is no accident, the compilation error is C1004, and the file that indicates that you go wrong is WABTags.h. I spent some time, and finally determined the problem in Microsoft. In WABTags.h, there is a non-printing character in front of the * number, which is 0xA0. This is not a problem under the English platform, and the compiler is simply slightly annotated. But the problem under the Chinese platform came out. 0xA0 is the legal LeadByte of the GB2312 character set (so-called LeadByte means two bytes of characters (such as Chinese characters)

The first byte). So the compiler treats 0xA0 and the following * as a character of the double-word character set. So the entire file becomes non-compliant grammar rules.

From this question, I will take a small header file in Microsoft. Found that the situation containing invalid characters is still full, but most of the time, these invalid characters

Does not produce problems (because they are in the comments and have no chance to swallow normal characters).

And these issues should have more than 5 years.

Someone replied to me ahead: Don't say any designer, do a programmer in Microsoft, more than your designer. I don't see this sentence from or not, at least I can see a blind worship against Microsoft. I think this idea also has considerable representation. There will be a problem with this kind of emotion. Don't forget Microsoft's procedures, it is written, so they will make mistakes. In the extension, the master's words are also said, so there will be errors. To say that the old saying, I believe that others, don't forget to believe in yourself.

转载请注明原文地址:https://www.9cbs.com/read-20939.html

New Post(0)