Keil uVision uses error masking to completely eliminate warning: #1-D: last line of file ends without a newline method

You must have seen this problem many times, it is very annoying.

In fact, everyone can understand by searching casually. The reason for this problem is that uVision's default compilation will expect us to add a blank line at the end of the file. If we add it, it will be correct. If we don't, it will report an error.

But today I came across a way to permanently eliminate this warning: using uVision’s warning mask. uVision can partially ignore some warnings.

First of all, the prompt information of our warning is #1-D, which means that its number is 1.

We click the magic wand-C/C++ and make the following settings:

image-20231109025628789

Enter --diag_suppress=1 to block warning No. 1. –diag_suppress= blocks specific warning content, including other warnings that you want to block. You can also use this method.

In this way, we will never have the annoying problem of adding an extra line in our current project.

image-20231109030154650

Guess you like

Origin blog.csdn.net/jtwqwq/article/details/134302198