-4

These will be the flags used to run my code, I am a beginner in C and don't know what each one is used for. The code I must write for this is basically a string manipulation. Wonder if there is a website that gets many flags together?

gcc -g -lm -std=c99 -Wall -Wextra
phuclv
  • 32,499
  • 12
  • 130
  • 417
Porton_
  • 37
  • 4
  • 6
    *Wonder if there is a website*. Yes, it's called the [gcc user manual](https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html). – kaylum Feb 15 '21 at 02:04
  • when in doubt about any Linux commands run `command --help` or `man command`. In this case run `gcc --help` – phuclv Feb 15 '21 at 03:34

1 Answers1

3

gcc - the compiler program
-g - makes it easier / possible to debug the program in a debugger such as gdb - read more about it in another StackOverflow topic
-lm - link to the library libm (the math library)
-std=c99 - use the C standard from 1999
-Wall - enables all warnings about constructions that some user consider questionable, and that are easy to avoid
-Wextra - enables some extra warning flags that are not enabled by -Wall

You can read more about GCC warnings here

Programmer
  • 5,276
  • 3
  • 9
  • 33