AutoGen-erated Fixincludes

How to Fix an Include

This is just a brief summary. The detailed information can be found in the gcc sources: gcc/fixinc/README.

  1. Define a new fix in the file, "gcc/fixinc/inclhack.def".
  2. Run, "genfixes" to regenerate "fixincl.x".
  3. Rebuild the compiler.

There is no need to comprehend immensly complex shell scripting. There is a little bit of effort required to "define a new fix", but the syntax and examples are fairly simple and straight forward. Here is a very simple example that changes a reserved word used as a prototype argument into a non-reserved word. For the real details, see the README:

 *  class in Xm/BaseClassI.h
fix = {
    hackname  = x11_class_usage;
    files     = Xm/BaseClassI.h;
    bypass    = "__cplusplus"; /* skip fix if C++ aware */

    select    = " class\\)";   /* apply fix if found */
    c_fix     = format;
    c_fix_arg = " c_class)";

    test_text = "extern mumble (int  class);\n";

This "include hack" will replace every occurrance of " class)" in the file ``/usr/include/Xm/BaseClassI.h'' with " c_class)", thus converting the test_text to:

    extern mumble (int  c_class);
The "select" expression is a regex regular expression.

The AutoGen tool can do other things, too, of course. The interested are invited to read its doc and, please, let me know if they put it to work, even if it is only for Automated Option Processing. (AutoOpts is included with AutoGen).

Viewable With Any Browser

AutoGen, AutoOpts, columns, getdefs, AutoFSM, AutoXDR and these web pages copyright (c) 1999, 2000, 2001 Bruce Korb, all rights reserved.

fixincludes copyright (c) 1999, 2001 the Free Software Foundation, all rights reserved.