Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's your favorite g++ option? [closed]

I am a newbie in C++ programming. When compiling I never use any option.

This is my day to day command:

g++ MyCode.cc -o MyCode 

For safety practice what's the best option to use?

like image 775
neversaint Avatar asked Feb 20 '09 08:02

neversaint


People also ask

What is an open or closed question?

Open-ended questions are questions that allow someone to give a free-form answer. Closed-ended questions can be answered with “Yes” or “No,” or they have a limited set of possible answers (such as: A, B, C, or All of the Above).

How do I get to my Google favorites?

1. To show Bookmarks in Chrome, click the icon with three horizontal bars in the top right corner to open the control panel. 2. In the control panel, hover over "Bookmarks" to display a second menu where you can click the "Show bookmarks bar" text to toggle the bar on or off.


2 Answers

g++ -W -Wall -Werror 

Will display all errors and warnings possible and treat them as errors.

like image 53
LiraNuna Avatar answered Oct 14 '22 15:10

LiraNuna


“-Werror”: treats all warnings as errors so you have to fix them. Incredibly valuable.

like image 41
Bombe Avatar answered Oct 14 '22 15:10

Bombe