diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2016-01-25 15:18:13 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-01-25 16:04:59 +0100 |
commit | 128b678061120270d3d4fe3eccd1b7dc76a8de35 (patch) | |
tree | db70c47ebbf1d9f9f5b8db185554836f80d32ae2 /docs/users_guide | |
parent | 6e2658f67bcdbc7fd0ebd2ef6abcd13a6bec80bc (diff) | |
download | haskell-128b678061120270d3d4fe3eccd1b7dc76a8de35.tar.gz |
user-guide: Note order-dependence of flags
This supplements the description previously added in
6400c7687223c5b2141176aa92f7ff987f61aba6. See #10560 for details.
Test Plan: read it
Reviewers: austin
Subscribers: thomie, hvr
Differential Revision: https://phabricator.haskell.org/D1831
GHC Trac Issues: #10560
Diffstat (limited to 'docs/users_guide')
-rw-r--r-- | docs/users_guide/using.rst | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst index 91b62919b8..3b192ef1dc 100644 --- a/docs/users_guide/using.rst +++ b/docs/users_guide/using.rst @@ -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 |