Keil Logo

Technical Support

On-Line Manuals

Compiler Reference Guide

Preface armclang Command-line Options Support level definitions Summary of armclang command-line options -C -c -D -E -e -fbare-metal-pie -fbracket-depth=N -fcommon, -fno-common -fdata-sections, -fno-data-sections -ffast-math, -fno-fast-math -ffixed-rN -ffp-mode -ffunction-sections, -fno-function-sections -fident, -fno-ident @file -fldm-stm, -fno-ldm-stm -fno-builtin -fno-inline-functions -flto, -fno-lto -fexceptions, -fno-exceptions -fomit-frame-pointer, -fno-omit-frame-pointer -fropi, -fno-ropi -fropi-lowering, -fno-ropi-lowering -frwpi, -fno-rwpi -frwpi-lowering, -fno-rwpi-lowering -fshort-enums, -fno-short-enums -fshort-wchar, -fno-short-wchar -fstack-protector, -fstack-protector-all, -fstack- -fstrict-aliasing, -fno-strict-aliasing -ftrapv -fvectorize, -fno-vectorize -fvisibility -fwrapv -g, -gdwarf-2, -gdwarf-3, -gdwarf-4 -I -include -L -l -M, -MM -MD, -MMD -MF -MG -MP -MT -march -marm -masm -mbig-endian -mbranch-protection -mcmse -mcpu -mexecute-only -mfloat-abi -mfpu -mimplicit-it -mlittle-endian -mmemtag-stack, -mno-memtag-stack -mno-neg-immediates -moutline, -mno-outline -mpixolib -munaligned-access, -mno-unaligned-access -mthumb -nostdlib -nostdlibinc -o -O -pedantic -pedantic-errors -Rpass -S -save-temps -std --target -U -u -v --version --version_number --vsn -W -Wl -Xlinker -x -### Compiler-specific Keywords and Operators Compiler-specific Function, Variable, and Type Att Compiler-specific Intrinsics Compiler-specific Pragmas Other Compiler-specific Features Standard C Implementation Definition Standard C++ Implementation Definition armclang Integrated Assembler armclang Inline Assembler


1.3 -C

Keeps comments in the preprocessed output.

By default, comments are stripped out. Use the -C option to keep comments in the preprocessed output.

With the -C option, all comments are passed through to the output file, except for comments in processed directives which are deleted along with the directive.


You must specify the -E option when you use the -C option.

Using the -C option does not implicitly select the -E option. If you do not specify the -E option, the compiler reports:

warning: argument unused during compilation: '-C' [-Wunused-command-line-argument]

The -C option can also be used when preprocessing assembly files, using:

  • -xassembler-with-cpp, or a file that has an upper-case extension, with the armclang integrated assembler.
  • --cpreproc and --cpreproc_opts with the legacy assembler, armasm.


Here is an example program, foo.c, which contains some comments:

#define HIGH 1 // Comment on same line as directive
#define LOW 0
#define LEVEL 10
// #define THIS 99

// Comment A
/* Comment B */

int Signal (int value)
  if (value>LEVEL) return HIGH; // Comment C
  return LOW + THIS;

Use armclang to preprocess this example code with the -C option to retain comments. The -E option executes the preprocessor step only.

armclang --target=aarch64-arm-none-eabi -mcpu=cortex-a53 -C -E foo.c

The output from the preprocessor contains:

// #define THIS 99

// Comment A
/* Comment B */

int Signal (int value)
  if (value>LEVEL) return 1; // Comment C
  return 0 + THIS;

The preprocessor has kept the following comments:

  • // #define THIS 99
  • // Comment A
  • /* Comment B */
  • // Comment C

The #define directives HIGH and LOW have been converted into their defined values, and the comment alongside HIGH has been removed. The #define directive THIS is considered a comment because that line starts with //, and therefore has not been converted.

Non-ConfidentialPDF file icon PDF version100067_0612_00_en
Copyright © 2014–2019 Arm Limited or its affiliates. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.