Giter Site home page Giter Site logo

spellhell's Introduction

spellhell: GCC-plugin to spell check string literals
====================================================

What
----
Ok, so you have that fancy new piece of software done!  By done, I mean:
compiled, tested, packaged, and distributed to the most honorable of your
customers.  But wait! Did you even spell check the output?  Well, have no fear
my GCC loving monkey boy, as that is what spellhell is for!  Spellhell is a GCC
plugin that runs a program's string literals through aspell such that
misspellings will generate a compile warning.

This work was originally created as a simple example for an introductory article
I wrote on how to create GCC plugins.  This version is slightly different from what
was originally written.
<https://lwn.net/Articles/457543/>


Dependencies
------------
GCC version 4.5 introduced plugins.  The most recent version of spellhell has
been built and tested on 4.8 thus, for older versions, your mileage might vary.
Apsell is also required, you probably already have it, if not:
<http://www.aspell.net>.


Build
-----
This is a GCC plugin and uses the plugin framework built with g++ in version 4.8
of GCC.  To build things simply run `make' from the spellhell directory.


Use
---
Next time you build with GCC 4.8 or higher include the spellhell plugin by
passing the '-fplugin=spellhell.so' flag to GCC.

GCC will emit a warning if a string contains a misspelling.  By default the
LOCALE is set to en_US.  Oh, and if you are a masochist, run GCC with -Werror to
terminate compilation if a misspelling occurs.


Caveat
------
If you run your PhD dissertation through this and you still get no spelling
warnings, clearly you have been at things too long.  Go home!  In other words,
if you rely on this 100% for spelling accuracy, don't blame me when your
users submit bug tickets with your spelling mistakes.


Install
-------
GCC must know where spellhell.so is located in order to use it.
You can install this plugin where GCC  recognizes your other plugins by copying
spellhell.so there.  The common plugin directory can be found by issuing the
following argument to GCC: `gcc -print-file-name=plugin'  You will still have to
issue the '-fplugin=spellhell.so' flag for the magic to get rockin'.

But wait, what's easier is that you can merely specify the full path to the
plugin when you compile your program:
`gcc foo.c -fplugin=/path/to/spellhell.so'


Contact
-------
Matt Davis (enferex)
[email protected]

spellhell's People

Contributors

enferex avatar xaizek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.