commit ddec8fe123dc108f360e92a969a53e362b42e87e Author: David Malcolm dmalcolm@redhat.com Date: Thu Sep 29 16:01:31 2011 -0400
add spell-checking example to docs
docs/working-with-c.rst | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) --- diff --git a/docs/working-with-c.rst b/docs/working-with-c.rst index eb8251e..ae4ba7b 100644 --- a/docs/working-with-c.rst +++ b/docs/working-with-c.rst @@ -46,3 +46,29 @@ Here's the expected output:
Notice how the call to `printf` has already been optimized into a call to `__builtin_puts`. + + +Spell-checking string constants within source code +-------------------------------------------------- + +This example add a spell-checker pass to GCC: all string constants are run through the "enchant" spelling-checker: + + .. code-block:: bash + + $ ./gcc-with-python tests/examples/spelling-checker/script.py input.c + +The Python code for this is: + + .. literalinclude:: ../tests/examples/spelling-checker/script.py + :lines: 18- + :language: python + +Given this sample C source file: + + .. literalinclude:: ../tests/examples/hello-world/input.c + :lines: 19-26 + :language: c + +these warnings are emitted on stderr: + + .. literalinclude:: ../tests/examples/spelling-checker/stderr.txt