5.6.3 xc-dsc-gcc (DSC C Compiler)
Although the MPLAB XC-DSC C Compiler works with MPLAB X IDE, it must be acquired separately. The full version may be purchased, or a student (limited-feature) version may be downloaded for free. See the Microchip website (MPLAB® XC Compilers) page for details.
A subset of command-line options may be specified in MPLAB X IDE. Select a category and then set up compiler options. For additional options, see the 6.6 Driver Option Descriptions.
See also 5.6.6 Options Page Features.
Option | Description | Command Line |
---|---|---|
Generate debugging info | Check to create an ELF file with information
to allow debugging of code in MPLAB X IDE. Uncheck for production code. |
-g |
Isolate each function in a section | Check to place each function into its own
section in the output file. The name of the function determines the section’s
name in the output file. Note: When you specify this
option, the assembler and linker may create larger object and executable
files and will also be slower. Uncheck to place multiple functions in a section. |
-ffunction-sections |
Place data into its own section | Place each data item into its own section in
the output file. The name of the data item determines the name of the section. When you specify this option, the assembler and linker may create larger object and executable files and will also be slower. |
-fdata-sections |
Use 64-bit double | Use long double instead of
double type equivalent to float. Mixing this option across
modules can have unexpected results if modules share double data either
directly through argument passage or indirectly through shared buffer
space. |
-fno-short-double |
Fill upper value for data in flash | Fill upper flash memory with the value specified. | -mfillupper=value |
Name the text section | Place text (program code) in a section named
name rather than the default .text
section. |
-mtext=name |
Option | Description | Command Line |
---|---|---|
Code model | Select a code (program memory/ROM) model. - default - large (>32 K words) - small (<32 K words) |
|
Data model | Select a data (data memory/RAM) model. - default - large (device dependent1) - small (device dependent1) |
device dependant2
|
Scalar model | Select a scalar model. - default - large (device dependent1) - small (device dependent1) |
|
Location of constant model | Select a memory location for constants. - default - Data - Code |
|
Place all code in auxiliary flash | Place all code from the current translation unit into auxiliary Flash. This option is only available on devices that have auxiliary Flash. | -mauxflash |
Put constants into auxiliary flash | When combined with -mconst-in-code, put constants into auxiliary Flash. | -mconst-in-auxflash |
Allow arrays larger than 32K | Allow arrays that are larger than 32K, regardless of memory model. | -menable-large-arrays |
Aggregate data model | Use aggregate data model. | -mlarge-aggregate |
Note:
|
Option | Description | Command Line |
---|---|---|
Optimization Level | Select an optimization level. Equivalent to
-On option, where n is an
option. See 6.6.6 Options for Controlling Optimization.Your compiler license may support only some optimizations. See 19 Optimizations |
-On |
Unroll loops | Check to perform the optimization of loop
unrolling. This is only done for loops whose number of iterations can be
determined at compile time or run time. Uncheck to not unroll loops. |
-funroll-loops |
Omit frame pointer | Check to not keep the Frame Pointer in a register for functions that don’t need one. Uncheck to keep the Frame Pointer. |
-fomit-frame-pointer |
Unlimited procedural abstraction | Enable the procedure abstraction optimization. There is no limit on the nesting level. | -mpa |
Procedural abstraction | Enable the procedure abstraction optimization up to level
n .Equivalent to -mpa=n option, where
n equals:
|
-mpa=n |
Option | Description | Command Line |
---|---|---|
Include C dirs | Add the directory dir to the head of the list of
directories to be searched for header files.For more information, see 5.6.7 Additional Search Paths and Directories. |
-I"dir" |
Define C macros | Define macro macro with the
string 1 as its definition. |
-Dmacro |
ANSI-std C support | Check to support all (and only) ANSI C
programs. Uncheck to support ANSI and non-ANSI programs. |
-ansi |
Use CCI syntax | Check if your code is written per the Common
C Interface (CCI) syntax (see 24 Common C Interface). Uncheck if you are not. |
-mcci |
Use IAR syntax | Check if your code is written per the
Embedded Compiler Compatibility Mode syntax for IAR (see 23 Embedded Compiler Compatibility Mode). Uncheck if you are not. |
-mext=IAR |
Errata | This option enables specific errata
work-arounds identified by ID. Valid values for ID change from time to time
and may not be required for a particular variant. The ID
|
-merrata=id |
Smart IO forwarding level | This option attempts to statically analyze
format strings passed to printf, scanf and the ‘f’ and ‘v’ variations of these
functions. Uses of nonfloating point format arguments will be converted to use
an integer-only variation of the library functions. Equivalent to
-msmart-io=n option where n equals:
|
-msmart-io=n |
Smart IO format strings | Specifies what the format arguments are when the compiler is unable to determine them. | |
Make warnings into errors | Check to halt compilation based on warnings as well as
errors. Uncheck to halt compilation based on errors only. |
-Werror |
Additional warnings | Check to enable all warnings. Uncheck to disable warnings. |
-Wall |
Strict ANSI warnings | Check to issue all warnings demanded by strict ANSI
C. Uncheck to issue all warnings. |
-pedantic |
Disable ISR warn | Disable warning for inappropriate use of ISR function names.
By default the compiler will produce a warning if the
interrupt is not attached to a recognized interrupt vector
name. This option will disable that feature. |
-mno-isr-warn |
Enable SFR warnings | Enable warnings related to SFRs. | -msfr-warn=on|off |