Comeau C/C++TM 4.3.3 Front-End
Additional information for MS-Windows customers

As the Comeau home page mentions, 4.3.3 is jam packed with new features. This is especially true for the Windows port of Comeau C++. So, please READ THIS DOCUMENT IN FULL, even if you've already used a beta version. As well, it will be handy to read the revised libcomo documentation specific for this particular 4.3.3 release. Some highlights of this Comeau C/C++ 4.3.3 release include:

Details of 4.3.3 for MS-Windows follow:

  1. Comeau C/C++ 4.3.3 is available for use with MS-Windows in a so-called "DOS box" (IDE integration is not yet possible, but something that we are working on). As with all non-custom ports since 4.0, Comeau C/C++ for MS-Windows costs $50. It is available at that price for use with MS-Windows XP, MS-Windows 2000, MS-Windows NT, MS-Windows ME, MS-Windows 98 and MS-Windows 95 with only the C compilers detailed below. See our main web page for other Comeau platforms, or if you need to tailor it for use with another C compiler, see customizations.
  2. Comeau C/C++ for MS-Windows has now been tailored for use with more C compilers. We feel that supporting these additional compilers will give folks an amazing flexibility of choice previously not possible. This will provide them a broad range of possibilities, including economically reasonable choices whether from say a budget minded student wanting to use it with a freely downloadable C compiler, to just somebody with different personal favorites, etc. etc.

    Until now, Comeau C/C++ had been extensively tested with the C part of MS Visual C++. The tailored compilers supported now include:

    Note that these are MINIMUM VERSION REQUIREMENTS. Using versions less than those shown, or using other C compilers, won't work and so will be a waste of your time. Contact us if you are not clear whether you have the correct version of a compiler or not, or if you have a compiler not shown above. Although Comeau C/C++ can be tailored to generate native object code, all currently available ports generate C as their object code. As such, one or more C compilers have been extensively tested with each operating system it is available for. Furthermore, the generated C code is C compiler specific. If you need to use Comeau C/C++ with another C compiler, then you need to contact us about a custom port (you will not be able to do it yourself as there are many dependencies throughout the Comeau C++ compile process that depend upon each other, depend upon being correct, and depend upon being done in a specific way and obviously Comeau Computing is the only entity who can change this). For some more information on this, see:
  3. Since there is now more than one backend available under Windows, there needs to be a way to choose which C compiler you want to use with Comeau C/C++, since you may actually have more than one installed. There are therefore new command line options available to allow you to control which C compiler you want to use:
  4. Having so many choices to specify the C compiler in the previous bullet would mean that you have to always specify which compiler you want to use. Therefore, there is now an additional file based mechanism to control which compiler to choose:
  5. IMPORTANT NOTES to consider when requesting the backend C compiler:
  6. IMPORTANT NOTES on compiler clashes. These really have nothing to do with Comeau C/C++ per se, but just come up as issues to watch out for:
  7. A new version of libcomoTM, http://www.comeaucomputing.com/libcomo is also now available to support Comeau C/C++ 4.3.3. It is able to support Comeau C/C++ with VC++ 4.0-6.0, VC++ 7.0, MinGW, Borland, lcc-win32, Digital Mars and Metrowerks CodeWarrior backends. Note again that you may need to be upgrade your C compiler in order for it to be used with Comeau C++ and/or libcomo.
  8. Debugging? Comeau C/C++ can be used with your C compiler's debugger. To enable debugging, you'll need to use the C compiler's command line switch as a "slash option" on your invocation of como. So, for instance, with Borland, instead of -v use /v. Or, with Microsoft, you can compile with the /Zi command line option (specify these when compiling and when linking). The respective debugger will display your C++ source code (or your C source in the case that you're using a C mode of Comeau C/C++). Note however that the name mangling formulas will be different between Comeau and the backend compiler. Therefore, if you want to set a breakpoint manually, then you will need to use the mangled Comeau name. On the other hand, you can set breakpoints graphically. For instance, with Microsoft, by right clicking your mouse, just like the way you would do it with any app. As well, you can manually breakpoint on a particular line, by entering, say with Microsoft, something such as:
    {,YourFile.c,} .99
    (where 99 is the line number) into the breakpoint window box input field. Note that name mangling is not an issue in C mode, or with extern "C"'d functions, so you can use those names directly, if you want, in addition to the above choices.

    Debugging code generated with MinGW, Borland, lcc-win32, Digital Mars, or MetroWerks CodeWarrior as the backend is still something that we need to look into further, but should work similarly to VC++ and Borland. We welcome your feedback on this.

  9. Note that in the general online document that options accepting spaces should use an equal sign instead when used with Comeau C++ for Windows. The equal sign is also accepted in non-Windows versions for those worried about keeping make files or other tool information intact.
  10. MODES. Note that when you invoke Comeau C/C++ under Windows, it will tell you what mode it is in. If you look, you will see that under Windows, the default mode is not Comeau strict mode, or even Comeau relaxed mode, instead it depends upon your backend C compiler. For instance, with Microsoft, --microsoft is the default mode (as is --microsoft_bugs mode). This allows compatibility with the MS header files, etc.

    Note that to use Comeau C/C++ in strict mode under MS-Windows do not just specify --no_microsoft and/or --no_microsoft_bugs, as that doesn't usually help much unless you don't use header files. Similarly, do not just specify the -A or -a option (note these have one dash). Instead, to use Comeau C/C++ in strict mode under MS-Widows, use the --A or --a options (note these have two dashes) options. They will allow you to use many of the Microsoft, Borland, MinGW, lcc-win32, Metrowerks CodeWarrior and Digital Mars header files in strict mode, as well as those from libcomo. We have not tested it with every header file though, so some may still be problematic. Please report those that are.

    Note as well that some of the Borland and MetroWerks header files do not end in a newline, so you may find you cannot use --A and instead must use --a (unless you actually go in and add a newline to the Borland or Metrowerks header files that have this problem). Similarly, you may want to choose --a if you want to use something like long long. New since 4.3.0.1 though is that you can specify --long_long (as an extension) while in strict mode.

    Use of these options also mean that --wchar_t, -D_WCHAR_T_DEFINED and --no_microsoft_bugs are no longer necessary to have to explicitly specify on the command line. As well, if libcomo gets automatically established as described below, you don't have to explicitly specify libcomo paths any longer either. Since the 4.2.45.2 "c" releases, in most cases, all you have to specify to como is the file name simplifying your command lines and makefiles! Note too that new options --no_A and --no_a are supported. This might be handy if you are using an @ file (another new feature, see below).

    Last but not least, see below for C compiler header file changes that may be necessary.

  11. In order to effectively use como under MS-Windows, which is found in \<YourComeauDir>\bin\como.exe, you will need to set the following environment variables (Note: Each of the below is one line, however, your browser may line wrap them giving the appearance that an environment variable is on a line by itself -- it isn't):

    set PATH=....;Drive:\YourComeauDir\bin;...
    set COMO_XXX_INCLUDE=Drive:\YourCIncludeDir


    where XXX is described below. You may also optionally set:

    set COMO_LIB_BASE=Drive:\WhereLibcomoIs
    set COMO_INCLUDE=Drive:\Dir1;Drive:\DirN
    set TMPDIR=Drive:\SomeWriteableTemporaryDirectory
    set COMO_BASE=Drive:\YourComeauDir


    Environment variable notes:

    Environment variable notes:

    Environment variable SAMPLE SETUPS:

  12. To invoke Comeau C/C++ under MS-Windows, you will use the como command. Please use it to compile your source files. The default name of the resulting executable produced is aout.exe.
    Comeau C++>como file.cpp
    Comeau C++>aout
    Comeau C++>como file1.cpp file2.cpp
    Comeau C++>aout
    
    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.obj
    
    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
    
    Note that you must also use como when link'ing your object files.
    Comeau C++>link xyz.obj  Don't do this, this is an error
    Comeau C++>como xyz.obj  Compile xyz.obj into aout.exe
    
    To override the default file name, use the -o option. For instance:
    Comeau C++>como xyz.c
    Comeau C++>aout
    <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.obj b.obj
    Comeau C++>xyz
    
    Do not use a file extension with -o:
    Comeau C++>como -o abc.exe xyz.c      Don't do this
    
    And do note that there is whitespace after -o, so this is not allowed:
    Comeau C++>como -oabc xyz.c
    
    Support for -o'ing to different directories and -o'ing of object files is now available. This option expects the burden of specifying proper file extensions for object files to be upon you.

    Mixing compiler is not fruitful:

    Comeau C++>como -c --vc71 xyz.cpp
    Comeau C++>como --bcc xyz.obj     Don't do this
    
    Mixing languages should be ok so long as you're using the same backend C compiler and you've used extern "C", etc.
    Comeau C++>como -c --c99 cpart.c
    Comeau C++>como -c cpppart.cpp
    Comeau C++>como cpart.obj cpppart.obj  Should be ok
    Comeau C++>aout
    
  13. As with when you use Microsoft VC++'s cl by itself, your compile using Comeau C/C++ may produce the following linker diagnostic:
    LINK: warning LNK4224: /DEBUGTYPE:BOTH is no longer supported; ignored
    
    This means that you need to specify that you're using VC++ 7.x as the backend C compiler (via either the --vc71 or --vc7 command line option or the default.vc71 or default.vc7 control file). If you don't, the linker might still create an executable but it will be erroneous.

    As well, note that if you get the following message:

    LINK : fatal error LNK1561: entry point must be defined
    This means that you are missing a main(). Using with a MinGW gcc backend might produce:

    undefined reference to `WinMain@16'

    and means the same thing. Similarly for some of the other compilers. Note that some C compilers will still create the executable file and even mark it executable, so don't run it, as it will no doubt not be a good thing to do.
  14. Do note that Comeau C++ makes every effort to support the language features of Standard C++. Depending upon which source you are compiling, you may or may not have to enable or disable exception handling (-x, --no_exceptions), the bool data type (--bool, --no_bool), or wide-characters (--wchar_t, --no_wchar_t), etc. That said, Comeau C/C++ for Windows is in its "microsoft mode" by default. See the discussion earlier
  15. Sometimes is it desirable to capture the output of a command. This is often done with I/O redirection, for instance:

    como xyz.c > output

    Here, only standard output is sent to the file named output. The problem here is that command.com does not allow redirection of standard error. In order to allow this, you may specify the -% option to como, whereas standard error is sent to wherever standard output is being sent to. Consider:

    como -% xyz.c > output

    In this case, all diagnostics are sent to the file named output. We should also note that NT's command processor cmd.exe does allow redirection of standard error. As well, note that in a .BAT file that % is a special character, therefore in a .bat file you need to use -%%.

  16. Some source files may produce warnings that you may want to silence. To get rid of a specific diagnostic:
    1. First, do a como 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 for MS-Windows, there must be an equal sign between the suppress option and its argument, and there can be no spaces before or after the equal sign.

    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
    
  17. As with when you use Microsoft VC++'s cl by itself, your compile using Comeau C/C++ may produce the following linker diagnostic:

    LINK : fatal error LNK1104: cannot open file "LIBC.lib"

    This means that you need to provide a definition for your MSVC++ LIB environment variable, which is needed to point at the MSVC++ library path. This is necessary for using a routine from Standard C, such as printf. Often this might be done by running vcvars32.bat from your MS bin directory, or however you have VC++ set up.

    You have to set up some additional environment variables with Metrowerks CodeWarrior too, but you should not have this concern when using Comeau C++ with the Borland, MinGW, lcc-win32 or Digital Mars backends. If you do, please contact us.

  18. If you get a diagnostic along the lines of:
    Failure while executing 'XXX' compiler ...email Comeau for advice
    
    You should double check that you've made the shadow header file changes as detailed below.

    Additionally, there are some cases where parameter names are used in inline assember code. Here, the parameter names become mangled, but as inline assemble is not C++, the two names end up being different, and then the underlying C code generates an error. In such cases, it may be best to use stack offsets (displacements from the stack pointer) instead of the C++ identifier names of the parameters.

    If neither of these seem to be the case, definitely contact us with your details.

  19. If you have MSVC++, you will have a problem with some header files:
  20. If you are using Borland as the C backend, you are expected to add a shadow file for _stddef.h into the include\bcc directory (so you might have c:\como430\include\bcc\_stddef.h). Add this similar to the procedure described for Microsoft above.

    Look for the lines which set __STD whether __cplusplus is set or not. Change that block of code to this:

    #if defined(__COMO__)
    
    #undef __STD /* Just in case ctype.h already included */
    #ifdef __cplusplus
    #define __STD std /* Establish libcomo's definition */
    #else
    #define __STD
    #endif
    
    #else
    
    /* The original code block here, from the #ifdef to the #endif */
    
    #endif
    
  21. If you are using MinGW's gcc as the C backend, you are expected to add a shadow file for float.h, winnt.h, rpcdcep.h and winsock.h into the include\min directory. Add this similar to the procedure described for Microsoft above.
  22. If you are using Digital Mars as the C backend, this release expects you to add a shadow file for assert.h, stdio.h, float.h and win32\winnt.h into the include\dig directory. Add this similar to the procedure described for Microsoft above.
  23. If you are using Metrowerks CodeWarrior as the C backend, this release expects you to add a shadow file for cmath and math_config.h into the include\mw directory. Add this similar to the procedure described for Microsoft above. Note that we've already provided some header files for you that will automatically be in your Comeau installation. You should not need to change those already available.
  24. If you are using lcc-win32 as the C backend, this release currently does not expect you to add any shadow files into the include\lcc directory (they are included for you automatically in your Comeau installation).
  25. Some additions to como.exe are enumerated below:
Have you found a glitch in Comeau C/C++? No matter how small, please contact us.

Comeau Computing
91-34 120th Street
Richmond Hill, NY, 11418-3214
http://www.comeaucomputing.com


(c) © 1992-2013 Comeau Computing. All Rights Reserved.