Finding compiler options for Development

Tagged with General
Printer-friendly version

There is a way to get a full list of all options available for the Compiler, Assembler and Linker and save it for future reference. There are two options that are used. These options are -v and –help. For example to get the options using gcc do the following: gcc -v –help > compile-options.txt 2>&1 This will create the list in the file compile-options.txt. Any editor can then be used to look at the file.

3
Average: 3 (2 votes)
recommended tips for gcc
Submitted by ramkrsna on Tue, 08/12/2008 - 17:05.
  • Add debugging information the -g flag must be added.
  • To Control the level of optimization -O flag
  • Generating an optimized program with debugging information
    • gcc -g -O3 -o example example.c

p.s :: Uneccessary  optimization is a bad practise

Copyright © 2008 Linux Foundation. All rights reserved.
LSB is a trademark of the Linux Foundation. Linux is a registered trademark of Linus Torvalds