Commit 128b6780 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

user-guide: Note order-dependence of flags

This supplements the description previously added in
6400c768. See #10560 for details.

Test Plan: read it

Reviewers: austin

Subscribers: thomie, hvr

Differential Revision: https://phabricator.haskell.org/D1831

GHC Trac Issues: #10560
parent 6e2658f6
......@@ -85,6 +85,28 @@ all files; you cannot, for example, invoke
``ghc -c -O1 Foo.hs -O2 Bar.hs`` to apply different optimisation levels
to the files ``Foo.hs`` and ``Bar.hs``.
.. note::
.. index::
single: command-line; order of arguments
Note that command-line options are *order-dependent*, with arguments being
evaluated from left-to-right. This can have seemingly strange effects in the
presence of flag implication. For instance, consider
:ghc-flag:`-fno-specialise` and :ghc-flag:`-O1` (which implies
:ghc-flag:`-fspecialise`). These two command lines mean very different
things:
``-fno-specialise -O1``
``-fspecialise`` will be enabled as the ``-fno-specialise`` is overriden
by the ``-O1``.
``-O1 -fno-specialise``
``-fspecialise`` will not be enabled, since the ``-fno-specialise``
overrides the ``-fspecialise`` implied by ``-O1``.
.. _source-file-options:
Command line options in source files
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment