-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
  • 37,963
  • 15
  • 156
  • 475
Porton_
  • 113
  • 1
  • 5
  • 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

TheEagle
  • 5,808
  • 3
  • 11
  • 39