What are these and what do they do?
-Wall -W -Werror
I am using terminal in Ubuntu to compile programs with this command:
$ g++ -Wall -W -Werror main.cpp -o exec
Could anyone explain this to me?
the -g flag means install the package globally on your system.
the -g flag is a shorthand for the global configuration which sets the package install location to the folder where you installed NodeJS. This is useful when you need to run the package from the command line instead of using require() and import it to your code.
The "g" flag indicates that the regular expression should be tested against all possible matches in a string. Without the g flag, it'll only test for the first. So the /g flag is irrelevant when using the .
The 'S' option is the Save option in npm. It adds the npm package to your dependencies for your project. It's the same as --save .
-Wall
: enable a set of warning, actually not all.-W
: enable extra warning, it's advised to use -Wextra
instead which has the same meaning-Werror
: every warning is treated as an error.
See GCC documentation: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With