Should I always use the -Wall and -pedantic variables with g ++ when learning C ++?

Being -novice, I wonder if it is useful to use these flags (with g ++) when learning C ++?

thank

+3
source share
2 answers

As long as you understand that code samples written by others are more likely to lead to warnings with -Wall, then yes, this is a good flag because it will make you used to writing code free of any potential gray area that the compiler may to identify.

-pedantic, on the other hand, is a more complex case. This is what the GCC 4.4.4 man page says:

, ISO C ISO ++; , , , ISO C ISO ++. ISO C ISO C, -std.

ISO C ISO ++ ( -ansi -std, ISO C). GNU C ++. , .

-pedantic , __. Pedantic , __ __ ". , ; .

-pedantic ISO C. , , : , ISO, - , ISO C , , .

, ISO C, -. ​​ .

+2

, -Weffc++, , Effective ++ ( ).

, , . STL .

+1

Source: https://habr.com/ru/post/1777388/


All Articles