본문 바로가기

C언어 in 42Seoul (라피신)

c00

[gcc] Warning option 정리

 

 

 

 

 

 

 

gcc -Wextra -Wall -Werror a.c -o a

 

a.c 파일을 a라는 파일로 컴파일해줌

 

 

-Werror 옵션을 사용하면 기존의 Warnning 들을 모두 error 로 인식하기 때문입니다. 

출처: https://poplinux.tistory.com/tag/Werror [얼굴반반피곤합니다.]

egloos.zum.com/ssulsamo/v/5247105

 

gcc 컴파일 옵션 (2)

---------------------------------------------------- 기본 옵션 ---------------------------------------------------- gcc -W -Wall -O2 -o test test.c -Wall 모든 모호한 코딩에 대해서 경고를 보내는 옵션 -W 합법적이지만 모호한

egloos.zum.com

-Wall

모든 모호한 코딩에 대해서 경고를 보내는 옵션

 

Wextra-Wall에 의해 활성화되지 않는 추가적인 Warning flags(-Wclobbered -Wempty-body -Wignored-qualifiers -Wmissing-field-initializers -Wmissing-parameter-type (C only) -Wold-style-declaration (C only) -Woverride-init -Wsign-compare -Wtype-limits -Wuninitialized -Wunused-parameter (only with -Wunused or -Wall) -Wunused-but-set-parameter (only with -Wunused or -Wall))를 활성화합니다.

출처: https://sonseungha.tistory.com/521 [Developer's Delight]

 

ex01

 

a부터 z까지 출력하는게 맞나요?

m

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>

using namespace std;

void ft_print_comb(void)
{
for (int i = 0; i < 10; i++) {
for (int j = i+1; j < 10; j++) {
for (int n = j+1; n < 10; n++) {
if (i == 7 && j == 8 && n == 9) {
break;
}
cout << i << j<< n;
cout << ", ";
}
}
}
cout << 789;
}


int main() {
ft_print_comb();
return 0;
}

 

 

8번 푸는 중..

#include <stdio.h>

void ft_print_combn(int n);

int main()
{
	int i;
	scanf_s("%d", &i);

	ft_print_combn(i);
	return 0;
}

void ft_print_combn(int n) {


	


}

'C언어 in 42Seoul (라피신)' 카테고리의 다른 글

c04  (0) 2021.02.26
c04  (0) 2021.02.26
c00  (0) 2021.02.20
시험 대비 c 00  (0) 2021.02.19
shell_00  (0) 2021.02.18