Codewarrior™ Build Tools Reference for Freescale™ 56800/E Hybrid Controllers
Total Page:16
File Type:pdf, Size:1020Kb
Freescale Semiconductor, Inc. CodeWarrior™ Build Tools Reference for Freescale™ 56800/E Hybrid Controllers Revised 28 October 2004 For More Information: www.freescale.com Freescale Semiconductor, Inc. Metrowerks and the Metrowerks logo are registered trademarks of Metrowerks Corporation in the United States and/ or other countries. CodeWarrior is a trademark or registered trademark of Metrowerks Corporation in the United States and/or other countries. All other trade names and trademarks are the property of their respective owners. Copyright © 2004 Metrowerks Corporation. ALL RIGHTS RESERVED. No portion of this document may be reproduced or transmitted in any form or by any means, electronic or me- chanical, without prior written permission from Metrowerks. Use of this document and related materials are governed by the license agreement that accompanied the product to which this manual pertains. This document may be printed for non-commercial personal use only in accordance with the aforementioned license agree- ment. If you do not have a copy of the license agreement, contact your Metrowerks representative or call 1-800- 377-5416 (if outside the U.S., call +1-512-996-5300). Metrowerks reserves the right to make changes to any product described or referred to in this document without further notice. Metrowerks makes no warranty, representation or guarantee regarding the merchantability or fitness of its prod- ucts for any particular purpose, nor does Metrowerks assume any liability arising out of the application or use of any product described herein and specifically disclaims any and all liability. Metrowerks software is not authorized for and has not been designed, tested, manufactured, or intended for use in developing applications where the fail- ure, malfunction, or any inaccuracy of the application carries a risk of death, serious bodily injury, or damage to tangible property, including, but not limited to, use in factory control systems, medical devices or facilities, nuclear facilities, aircraft navigation or communication, emergency systems, or other applications with a simi- lar degree of potential hazard. How to Contact Metrowerks Corporate Headquarters Metrowerks Corporation 7700 West Parmer Lane Austin, TX 78729 U.S.A. World Wide Web http://www.metrowerks.com Sales United States Voice: 800-377-5416 United States Fax: 512-996-4910 International Voice: +1-512-996-5300 Email: [email protected] Technical Support United States Voice: 800-377-5416 International Voice: +1-512-996-5300 Email: [email protected] For More Information: www.freescale.com Freescale Semiconductor, Inc. Table of Contents 1 Introduction 13 Compiler Architecture . 13 Linker Architecture . 14 2 Using Build Tools with the CodeWarrior IDE 15 Invoking CodeWarrior Compilers and Linkers. 15 Specifying File Locations . 16 IDE Options and Pragmas. 16 IDE Settings Panels . 16 C/C++ Language (C only) Settings Panel . 16 C/C++ Preprocessor Panel . 21 C/C++ Warnings Panel. 23 3 Using Build Tools on the Command Line 29 Naming Conventions. 30 Configuring Command-Line Tools . 30 CWFolder Environment Variable. 30 Setting the PATH Environment Variable . 31 Invoking Command-Line Tools . 31 Getting Help . 32 Help Guidelines . 32 File Name Extensions . 34 Specifying Source File Locations . 34 Environmental Variables . 35 Standard C and C++ Conformance Options . 35 -ansi . 36 -stdkeywords . 36 -strict . 36 Language Translation and Extensions Options. 37 -char . 38 -defaults . 38 CodeWarrior Build Tools Reference for Freescale 56800/E Hybrid Controllers 3 For More Information: www.freescale.com Freescale Semiconductor, Inc. Table of Contents -encoding . 39 -flag . 40 -gccext . 40 -gcc_extensions . 40 -M. 41 -make . 41 -mapcr . 41 -MM . 42 -MD . 42 -MMD . 42 -multibyteaware . 43 -once. 43 -pragma . 43 -relax_pointers . 44 -requireprotos . 44 -search . 44 -trigraphs . 45 Errors, Warnings, and Diagnostic Options . 45 -disassemble . 46 -help . 46 -maxerrors . 47 -maxwarnings . 48 -msgstyle . 48 -nofail . 49 -progress . 49 -S . 49 -stderr . 49 -verbose . 50 -version. 50 -timing . 50 -warnings . 51 -wraplines. 54 Preprocessing and Precompilation Options . 54 4 CodeWarrior Build Tools Reference for Freescale 56800/E Hybrid Controllers For More Information: www.freescale.com Freescale Semiconductor, Inc. Table of Contents -convertpaths . 55 -cwd . 56 -D+ . 56 -define . 57 -E . 57 -EP . 58 -gccincludes . 58 -I- . 58 -I+. 59 -include. 59 -ir . 60 -noprecompile . 60 -nosyspath . 60 -P . 61 -precompile . 61 -preprocess . 62 -ppopt . 62 -prefix . 63 -stdinc . 63 -U+ . 63 -undefine . 64 Library and Linking Options . 64 -keepobjects . 64 -nolink . 65 -o . 65 Object Code Organization and Generation Options . 65 -c . 66 -codegen . 66 -enum . 66 -ext . 67 -strings . 67 Optimization Options . 68 -factor1 . 68 CodeWarrior Build Tools Reference for Freescale 56800/E Hybrid Controllers 5 For More Information: www.freescale.com Freescale Semiconductor, Inc. Table of Contents -factor2 . 69 -factor3 . 69 -inline . 69 -ipa . 70 -nofactor1 . 71 -nofactor2 . 71 -nofactor3 . 71 -O . 72 -O+ . 72 -opt . 73 4 Linker 76 5C 77 Extensions to Standard C . 77 Unnamed Arguments in Function Definitions . 78 C++ Comments . 78 A # Not Followed by a Macro Argument. 78 Using an Identifier After #endif . 79 Using Typecasted Pointers as lvalues . 80 Inline Functions . ..