0.11 Configuring your compiler: Warning and error levels

주홍영·2022년 3월 10일
0

Learncpp.com

목록 보기
11/199

https://www.learncpp.com/cpp-tutorial/configuring-your-compiler-warning-and-e
rror-levels/

error, providing both line number containing the error, and some text about what was expected vs what was found.

warning, Warnings do not halt compilation, but are notices to the programmer that something seems amiss.

Don't let warnings pile up(많아지다)
warning도 error처럼 생각하고 Resolve(해결) 하라

By default, most compilers will only generate warnings about the most obvious issues. However, you can request your compiler be more assertive about providing warnings for things it finds strange.
대부분 컴파일러는 분명한 issue에만 warning 사인을 발생한다
하지만 컴파일러에게 more assertive하도록 request할 수 있다.

Increasing your warning levels

For Visual Studio users

To increase your warning levels, right click on your project name in the Solution Explorer window, then choose Properties:

Solution Explorer Properties
From the Project dialog, first make sure the Configuration field is set to All Configurations.

Then select C/C++ > General tab and set Warning level to Level4 (/W4):
Enable Level 4 Warnings

Note: Do not choose EnableAllWarnings (/Wall) or you will be buried in warnings generated by the C++ standard library.

Treat warnings as errors

컴파일러에게 모든 warning을 error처럼 다루라고 할 수 있다
그러면 컴파일러는 warning을 찾으면 컴파일 하는 것을 그만 둘 것이다
이는 우리가 모든 warning을 고쳐야만 하도록 만드는 좋은 방법이다

For visual Studio users

To treat warnings as errors, right click on your project name in the Solution Explorer window, then choose Properties:

From the Project dialog, first make sure the Configuration field is set to All Configurations.

Then select C/C++ > General tab and set Treat Warnings As Errors to Yes (/WX).

**** 단어장

amiss : 잘못된
pile up : 많아 지다
pile : 차곡 차곡 쌓다, 포개놓다
assertive : 단호한
discipline : 규율
ex) if you lack self-discipline, which most of us do
enforce : 집행하다, 강요하다

profile
청룡동거주민

0개의 댓글