Skip to content

[clang][docs] Add docs for CCC_OVERRIDE_OPTIONS. #142396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions clang/docs/UsersManual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3743,6 +3743,35 @@ Doxygen-style comments and ignores ordinary comments starting with ``//`` and
``-fcomment-block-commands=foo -fcomment-block-commands=bar`` does the same
as above.

.. _ccc-override-options:

CCC_OVERRIDE_OPTIONS
--------------------
The environment variable ``CCC_OVERRIDE_OPTIONS`` can be used to edit clang's
command line arguments. The value of this variable is a space-separated list of
edits to perform. The edits are applied in the order in which they appear in
``CCC_OVERRIDE_OPTIONS``. Each edit should be one of the following forms:

- ``#``: Silence information about the changes to the command line arguments.

- ``^FOO``: Add ``FOO`` as a new argument at the beginning of the command line
right after the name of the compiler executable.

- ``+FOO``: Add ``FOO`` as a new argument at the end of the command line.

- ``s/XXX/YYY/``: Substitute the regular expression ``XXX`` with ``YYY`` in the
command line.

- ``xOPTION``: Removes all instances of the literal argument ``OPTION``.

- ``XOPTION``: Removes all instances of the literal argument ``OPTION``, and the
following argument.

- ``Ox``: Removes all flags matching ``O`` or ``O[sz0-9]`` and adds ``Ox`` at
the end of the command line.

This environment variable does not affect the options added by the config files.

.. _c:

C Language Features
Expand Down
Loading