Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcc : Is using -Werror and -pedantic considered good practice?

Tags:

People also ask

What is the GCC used for?

GCC is a key component of so-called "GNU Toolchain", for developing applications and writing operating systems. The GNU Toolchain includes: GNU Compiler Collection (GCC): a compiler suite that supports many languages, such as C/C++ and Objective-C/C++.

What is GCC and how it works?

GCC is an integrated collection of compilers for several major programming languages, which as of this writing are C, C++, Objective-C, Java, FORTRAN, and Ada. The GNU compilers all generate machine code, not higher-level language code which is then translated via another compiler.

What is the GCC in simple terms?

The Gulf Cooperation Council (GCC) is a political and economic alliance of six countries in the Arabian Peninsula: Bahrain, Kuwait, Oman, Qatar, Saudi Arabia and the United Arab Emirates.

What is GCC in process?

c extension and the command “gcc” is used to compile C source files. GCC stands for GNU Compiler Collection and it is a compiler system produced by the GNU project. There are four steps to the compilation process: preprocessing, compiling, assembly, and linking. Preprocessing.


I'm just digging into the gcc manual and some things are still unclear to me:

  1. When specifying a std, should I always use -pedantic in conjunction?
  2. When using -g, it the standard level sufficient or should I specify level 3, i.e. -g3?
  3. Is it good practice to use -Werror to promote all warnings to errors and -pedantic-errors to promote all pedantic warnings to errors?