Comeau C/C++TM 4.3.10.1 beta
Additional information for Plan 9 customers

When using Comeau C++ under Plan 9, you may come across the issues discussed below. Let's start with some details pertaining to this release:
  1. A binary license of this port is currently available on a limited, proprietary basis for $tbd through our normal ordering procedures.
  2. The port has been performed with:
  3. This port has been performed to work with Plan 9's underlying 8c C compiler, including via the cc interface. It is not yet available for use with any other Plan 9 C compiler setups, interfaces or versions.
  4. If you have a Plan 9 C compiler that is not 8c, you must contact us before use, as in this case we will need to make changes in order for it to work with the other compiler, whether that compiler comes with the genuine Plan 9 distribution or not.
  5. libcomo is being made available for Plan 9 too.
  6. As mentioned above, if you are interested in also seeing Comeau C++ target Plan 9 ARM or Plan 9 Power PC please contact us to discuss such a port!
  7. Need C++ or C extensions not available in the normal Plan 9 toolset? Maybe we can add them to Comeau C/C++ for Plan 9. If so, please contact us at support@comeaucomputing.com with your details and concerns.
  8. For some additional information about the Comeau compilers on Plan 9, see
    How to Use the Plan 9 Comeau C++ and Comeau C Compiler, an informative parody, also available in pdf.

Here's general info on this port which should transcend any particular version:

  1. When como43101.setup (or whatever version of this you are using, for instance como43101beta15.setup) asks you for the directory of your C++ SL, you'll be wanting to provide it with a C++ SL that is known to work with Comeau C++, such as libcomo (you only need to execute mk which will use mkfile, no other build changes should be necessary to establish it for use with Comeau C++ under Intel Plan 9).
  2. When you first install Comeau C++ on Intel Plan 9, don't inform como43101.setup about libcomo, instead tell it you don't have a standard library. Go build libcomo and only then go back and re-run como43101.setup telling it about libcomo. Note that to build libcomo, go into its directory and execute mk. It should finish with no errors and create a log file named makeout.
  3. long long is not part of Standard C++ and so its use will be an error by default in strict mode. However you may come across its use in some code. Therefore, Comeau C++ supports a --long_long option which can be enabled even when in strict mode. So, in such a case, you might have: como -A --long_long file.c When this option is disabled, the __NO_LONG_LONG macro is defined.
  4. If, in C++ mode, you get linker errors such as:
    c2.o: In function `main':
    c2.o(.text+0x14): undefined reference to `cout'
    c2.o(.text+0x19): undefined reference to `ostream::operator<<(char const *)'
    c2.o(.text+0x32): undefined reference to `cout'
    c2.o(.text+0x37): undefined reference to `ostream::operator<<(char const *)'
    c2.o(.text+0x42): undefined reference to `ostream::operator<<(int)'
    c2.o(.text+0x55): undefined reference to `endl(ostream &)'
    c2.o(.text+0x6e): undefined reference to `cout'
    c2.o(.text+0x73): undefined reference to `ostream::operator<<(char const *)'
    c2.o(.text+0x7e): undefined reference to `ostream::operator<<(int)'
    c2.o(.text+0x91): undefined reference to `endl(ostream &)'
    collect2: ld returned 1 exit status
    
    then it is possible that you have not built libcomo properly and/or have not told Comeau C++ to use libcomo after you built it. To resolve this, ensure you've built libcomo properly and also that you've run como43101.setup properly, telling it where your libcomo is.
  5. Comeau C/C++ for Plan 9 does support C programming as well via the --c (note two dashes) command line option. Note that we do not support so-called "Ken C" extensions, however, in C99 mode via --c99 (note two dashes) we do support those features that C99 borrowed from "Ken C" (compound literals, and designated initializers). Also, re "Ken C" note that it appears to not implement the initialization of some structs that have bitfields, in particular, even when intialized to { 0 } hence effecting some code passed through Comeau as well then.
  6. Comeau C/C++ for Plan 9 provides support for APE and native ("non-APE") programming modes. This is provided through two interfaces, namely the comoape and como commands respectively. Note that when you invoke Comeau C/C++, it will tell you what mode it is in. Please get a simple hello world app going before doing anything real to make sure you're set up ok. Note that como will produce .8 files by default (and will expect them as input) and comoape will produce .o files by default (and will expect them as input). Both interfaces result in a default executable program image output file name of 8.out. Note that to compile only use the -c (note one dash) command line option.
  7. Comeau C/C++ for Plan 9 requires you to use the Comeau C/C++ interface to compile and link. This means not using 8l directly, although, once you get object files, you are able to use ar to put them into libraries. You may also use mk to build, etc. so long as you have it use these interfaces and also consider options such as --prelink_objects (note two dashes) when building template libs, etc.
  8. In some cases, you'll need to establish a "closure" of a template library (not user code) with --prelink_objects, which ensures the right instantiations have been created to be placed into the library:
    como   -c  lib1.c  lib2.c     Compile to object files
    ar  libmylib.a lib1.8  lib2.8  Don't do this yet if instantiations possible
    como  --prelink_objects  lib1.8  lib2.8  Bring forth instantiations of these objects
    ar  libmylib.a lib1.8  lib2.8  Now ok
    como  app1.c  app2.c  libmylib.lib    Instantiations from libmylib intact
    
  9. If you get the following message:
    _main: undefined: main in _main
    This means that you are missing a main().
  10. Here's some examples to compile your source files using the como and comoape commands as mentioned above. The default name of the resulting executable produced is 8.out.
    Comeau C++>como file.cpp
    Comeau C++>8.out
    Comeau C++>comoape file1.cpp file2.cpp
    Comeau C++>8.out
    
    To compile only, without linking, use the -c command line option:
    Comeau C++>como xyz.c    Compile and link
    Comeau C++>como -c xyz.c Compile only, results in xyz.8
    Comeau C++>comoape -c xyz.c Compile only, results in xyz.o
    
    Do not confuse this with the --c (note two dashes not one) option which specifies C90 mode. So if you want to compile but not link a C90 source you'd write:
    Comeau C++>como -c --c c.c
    Comeau C++>comoape -c --c xyz.c
    
    Note that you must also use como when link'ing your object files.
    Comeau C++>8l c.8  Don't do this, this is an error
    Comeau C++>8l xyz.o  Don't do this, this is an error
    Comeau C++>como c.8  Compile c.8 into 8.out
    Comeau C++>comoape xyz.o  Compile xyz.o into 8.out
    
    To override the default file name, use the -o option. For instance:
    Comeau C++>como xyz.c
    Comeau C++>8.out
    <Output here>
    Comeau C++>como -o abc xyz.c
    Comeau C++>abc
    <Output here>
    
    Comeau C++>como -c a.cpp b.cpp
    Comeau C++>como -o xyz a.8 b.8
    Comeau C++>xyz
    
    And do note that it does not matter if there is whitespace after -o, so this is also allowed:
    Comeau C++>como -oabc xyz.c
    

    Mixing compiler modes is not fruitful:

    Comeau C++>como -c xyz.cpp
    Comeau C++>como xyz.8     Ok
    Comeau C++>comoape xyz.8     Don't do this
    
    Mixing languages (C and C++) should be ok so long as you're using the same mode, you've used extern "C", etc.
    Comeau C++>como -c --c99 cpart.c
    Comeau C++>como -c cpppart.cpp
    Comeau C++>como cpart.8 cpppart.8  Should be ok
    Comeau C++>8.out
    
  11. Comeau C/C++ for Plan 9 emits error messages pertaining to lines of code in "plumber" format.
  12. Note that the lib directory of the Comeau install tree contains libC43101NOEH.a and libC843101NOEH.a which are replacements for libC43101.a and libC843101.a respectively. They are to be used when exceptions are turned completely off (since the file names will need the original names, to use these two files you'll need to cp/mv the original and cp/mv these to those names, and similarly, when you want to not use the noeh versions you'll need to put the original files back. Upon use of --no_exceptions (note two dashes) across the board along with the use of these "noeh libs", it should render the executable code completely exceptions free. This means that a --no_exceptions'd libcomo needs to be (built in the first place and) used as well, otherwise that part will contain exceptions code, not what you'd want for meshing with the above.
  13. Some source files may produce warnings that you may want to silence. To get rid of a specific diagnostic:
    1. First, do a como (or comoape) run and specify --display_error_number. On a respective diagnostic, it might show #123-D, so the error number would be 123.
    2. Then, use that number (without the -D) to suppress the diagnostic, using --diag_suppress, for instance, '--diag_suppress=123'
    If you want to get rid of all warnings, then use --no_warnings.

    Note that you can only suppress a diagnostic with a -D on the error number. If it does not have a -D then you cannot suppress that particular diagnostic.

    Note also that you can specific multiple suppressions with multiple --diag_suppresses, for instance:

    '--diag_suppress=1' '--diag_suppress=9'   '--diag_suppress=111'
    
    or together seperated by commas (again with no embedded spaces):
    '--diag_suppress=1,9,111'
    
Have you found a glitch in Comeau C/C++? No matter how small, please contact us at support@comeaucomputing.com.

Comeau Computing
http://www.comeaucomputing.com
support@comeaucomputing.com

Last updated April 21, 2012
(c) © 1992-2012 Comeau Computing. All Rights Reserved.