[Linux] gcc -E 옵션

gcc --help를 입력하여 -E 옵션에 대한 설명을 살펴보면 아래와 같습니다.

GCC 10.2 Manual 에 34p에 gcc -E 옵션에 대한 설명은 다음과 같습니다.

Stop after the preprocessing stage; do not run the compiler proper. The output
is in the form of preprocessed source code, which is sent to the standard output.
Input files that don’t require preprocessing are ignored.

결과적으로, gcc -E 옵션은 preprocess 단계에서의 소스 코드를 확인할 수 있습니다.
실제로 바이너리에 포함되는 라이브리러 등의 정보 등을 확인할 때 -E 옵션을 유용하게 활용할 수 있습니다.

이 글은 카테고리: Linux에 포함되어 있습니다. 고유주소를 북마크하세요.

댓글 남기기