gcc

Warnings

Syntax#

  • gcc [-Woption [-Woption […]]] src-file

Parameters#

Parameter Details
option It can be used to enable or disable warnings. It can make warnings into errors.
src-file The source file to be compiled.
## Remarks#
It is a good practice to enable most warnings while developing a software.
## Enable nearly all warnings
## C source file ##
gcc -Wall -Wextra -o main main.c

C++ source file

g++ -Wall -Wextra -Wconversion -Woverloaded-virtual -o main main.cpp

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow