gcc -O

gcc -O option flags

gcc -O sets the compiler's optimization level.

Set the compiler's optimization level.

option optimization level execution time code size memory usage compile time
-O0 optimization for compilation time (default) + + - -
-O1 or -O optimization for code size and execution time - - + +
-O2 optimization more for code size and execution time --   + ++
-O3 optimization more for code size and execution time ---   + +++
-Os optimization for code size   --   ++
-Ofast O3 with fast none accurate math calculations ---   + +++

+increase ++increase more +++increase even more -reduce --reduce more ---reduce even more

Syntax

$ gcc -Olevel [options] [source files] [object files] [-o output file]

Example

myfile.c:

// myfile.c
#include <stdio.h>

void main()
{
    printf("Program run\n");
}

Build myfile.c on terminal and run the output file myfile:

$ gcc -O myfile.c -o myfile
$ ./myfile
Program run
$


Currently, we have around 935 calculators, conversion tables and usefull online tools and features to make your life easier or simply help you to do your work or duties faster and in more effective way. These below are the most commonly used by many users at all

And we are still developing more. Our goal is to become the one-stop, go-to site for people who need to make quick calculations or who need to find quick answer for basic conversions.

Additionally, we believe the internet should be a source of free information. Therefore, all of our tools and services are completely free, with no registration required. We coded and developed each calculator individually and put each one through strict, comprehensive testing. However, please inform us if you notice even the slightest error – your input is extremely valuable to us. While most calculators on Justfreetools.com are designed to be universally applicable for worldwide usage, some are for specific countries only.


This website uses cookies to improve your experience, analyze traffic and display ads. Learn more