HPlogo HP C/HP-UX Programmer's Guide: Workstations and Servers > Chapter 4 Optimizing HP C Programs

Limiting the Size of Optimized Code

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

You can disable optimizations that expand code size at the second, third, and fourth optimization levels by using the +Osize suboption, as follows:

cc +O2 +Osize sourcefile.c

or:

cc +O3 +Osize sourcefile.c

or:

cc +O4 +Osize sourcefile.c

Most optimizations improve execution speed and decrease executable code size. A few optimizations significantly increase code size to gain execution speed. The +Osize option disables these code-expanding optimizations.

Use this option if you have limited main memory, swap space, or disk space.

© Hewlett-Packard Development Company, L.P.