LintPlus embedded-system support
----------------------------------------------------------------------

1. Overview.

This document discusses LintPlus cross-linting issues, with particular
attention to embedded systems.

Section 2 lists  some embedded targets  that are explicitly supported.
Sections 3 and 4 describe generic procedures  that can be used for un-
supported targets.

----------------------------------------------------------------------

2. Built-in embedded targets.

Presently,  LintPlus supports the following embedded targets explicit-
ly:

      Platform                 System keyword (for -system=... switch)
      ---------------          --------------
      Metrowerks               METROWERKS
      Microtec                 MICROTEC
      Plessey ARM              PLESSEY-ARM
      TI-C2000                 TIC2000
      Windows CE               WINCE
      Wind River Diab          WRDIAB
      Zilog                    ZILOG-Z8 (or Z8)

If you're  running the LintPlus GUI,  just click on the "Analysis Opt-
ions" tab and select the appropriate  target system  using the "Target
System" drop-down box.

Alternatively, if you're running the command-line version of LintPlus,
use a command line similar to the following:

      UNIX example:
      lplus -system=WRDIAB -S/opt/diab/include   -ghstx *.c

      MS-Windows example:
      lplus -system=WRDIAB -SC:\TMP\diab\include -ghstx *.c

Substitute the  appropriate  system keyword for WRDIAB.  Additionally,
replace the  "-S" directory path  with  a full path  for the directory
where your cross-compiler header files are stored.

Note:  You can  specify  the  system keywords in  upper or lower case.
Additionally,  you can use  underscores instead of dashes (or drop the
dashes entirely).

For example: Plessey-Arm, plessey_arm, and PlesseyArm are equivalent.

----------------------------------------------------------------------

3. Generic cross-linting: GUI approach.

As noted in section 2,  LintPlus supports  a pre-defined set of target
systems.  Cleanscape will  implement  additional  targets  on request,
often within 24 hours of our access to the compiler's header files and
the associated manual.

Alternatively,  you may configure the standard version of  LintPlus to
cross-lint for other targets.

To  cross-lint  source code for an arbitrary target system, set up the
LintPlus GUI as follows:

        (a) Click on the "Analysis Options" tab and select the "Gener-
            ic" target using the "Target System" drop-down box.

        (b) Un-check the "System Library" checkbox on the same screen.
            This tells LintPlus  not to use the prototypes in "syslib.
            c".  (For more information on "syslib.c", see the LintPlus
            manual.)

        (c) Set the data-type size values on the same screen appropri-
            ately.

        (d) Click on the  "Misc Options" tab.  Edit  the "Standard in-
            clude" directories field and add a full path  for the dir-
            ectory  which  contains the  target system's  standard in-
            clude files ("stdio.h", etc.).

        (e) Edit the  "Define symbols" field  on the same screen.  Add
            one or  more  "-Dsymbol"  option  switches  to define  any
            architecture-related  symbols  required  by  the  standard
            "include" files, or by your project.

            Additionally,   add  any  application-specific  "-Dsymbol"
            switches required by the project.  Normally,  you can copy
            these switches from the project "Makefile".

        (f) Edit the  "Local include"  directories  field  on the same
            screen.  Add any application-specific "-Idirectory" option
            switches required by the project.  Normally,  you can copy
            these switches from the project "Makefile".

        (g) Set  the  remaining options on the  LintPlus configuration
            tabs ("Analysis Options", etc.) as desired.

If LintPlus produces  invalid syntax-error messages, your compiler may
be using special extensions.  In this case,  contact  "support@ clean-
scape.net".

To fine-tune the results,  you may want  to modify  the definitions in
"syslib.c"  appropriately  for your  target system.  However,  this is
optional.  After  you update  "syslib.c",  enable the "System Library"
option mentioned previously.

If you'd like to have  Cleanscape modify  "syslib.c" for you,  contact
"support@cleanscape.net".

----------------------------------------------------------------------

4. Generic cross-linting: Command-line approach.

As noted in section 2,  LintPlus supports  a pre-defined set of target
systems.  Cleanscape will  implement  additional  targets  on request,
often within 24 hours of our access to the compiler's header files and
the associated manual.

Alternatively,  you may configure the standard version of  LintPlus to
cross-lint for other targets.

To  cross-lint  source code for an  arbitrary target system,  create a
LintPlus command line as follows:

        (a) Specify the LintPlus option switch "-Snohost".  This tells
            LintPlus  not to use the host system's  standard "include"
            files.

        (b) Add the switch "-system=none".  This tells LintPlus not to
            assume any particular target system.

        (c) Add the switch "--lib" (dash dash "lib"). This tells Lint-
            Plus  not to use the prototypes in  "syslib.c".  (For more
            information on "syslib.c", see the LintPlus manual.)

        (d) Add a switch similar to the following:

            -size=short:16,int:16,long:32

            This switch specifies target-system data-type sizes. Modi-
            fy the numbers  shown here  appropriately  for your target
            system.  For example,  if the  "int" data type is  32 bits
            long, replace "int:16" with "int:32".

        (e) Add a switch similar to  "-Ssysdir".  "sysdir" should be a
            full path for  the directory  which  contains the  target-
            system's standard "include" files ("stdio.h", etc.).

        (f) Add one or more  "-Dsymbol" option switches  to define any
            architecture-related  symbols  required  by  the  standard
            "include" files, or by your project.

        (g) Add  application-specific "-Dsymbol" or "-Idirectory" opt-
            ion switches, as required.  (Normally,  you can copy these
            switches from the project "Makefile".)

        (h) Add normal LintPlus analysis switches, such as "-ghstx".

Sample UNIX command line:

        lplus -Snohost -system=none --lib \
              -size=short:16,int:32,long:32 \
              -S/opt/crosscompiler/include -Dsparc \
              -ghstx *.c

If the  command line becomes too long,  and you're working under UNIX,
you can use backslashes  to extend it (as shown here).  Alternatively,
you can use  a LintPlus  "command file"  (under both  UNIX and MS-Win-
dows).  To create a "command file",  just edit a text file and add the
command-line options that you want to use, spread across as many lines
as necessary. No backslashes are required.

Sample UNIX LintPlus "command file":

      -Snohost -system=none --lib
      -size=short:16,int:32,long:32
      -S/opt/crosscompiler/include -Dsparc
      -ghstx

MS-Windows version of the preceding example:

      -Snohost -system=none --lib
      -size=short:16,int:32,long:32
      -SC:\TMP\crosscompiler\include -Dsparc
      -ghstx

To use a "command file"  named (for example) "foo.txt",  execute Lint-
Plus commands of the following form:

      lplus @foo.txt *.c

Note:  The LintPlus  "command file" feature works  under both UNIX and
MS-Windows.

If LintPlus produces  invalid syntax-error messages, your compiler may
be using special extensions.  In this case,  contact  "support@ clean-
scape.net".

To fine-tune the results,  you may want  to modify  the definitions in
"syslib.c"  appropriately  for your  target system.  However,  this is
optional.  After you update "syslib.c",  drop the  "--lib" switch men-
tioned previously.

If you'd like to have  Cleanscape modify  "syslib.c" for you,  contact
"support@cleanscape.net".
