man cscc (Commandes) - the C-Sharp code compiler

NAME

cscc - the C-Sharp code compiler

SYNOPSIS

cscc [ options ] input ...

DESCRIPTION

Cscc compiles input source files, typically in the C# (pronounced C-Sharp) programming language.

OPTIONS

The command-line syntax of cscc has been deliberately designed to match that of C compilers such as gcc(1), to shorten the learning curve for new users. Use cscc /help to see the alternative syntax options available for compatibility with CSC.

Overall Options -c -S -E -o file -pipe -v -vv -x language
Language Options
-flatin1-charset -foctal-chars -foctal-constants -fdecimal-constants -fchecked -funchecked -fsyntax-check -fsemantic-check -funsafe -fhidebysig -fhidebyname
Warning Options
-Wall -Werror -w -W -Woctal-chars -Woctal-constants -Wunknown-escapes -Winvalid-utf8 -Wlarge-unicode-chars -Wmulti-char-constant -Wunsafe -Wempty-input
Debugging Options
-g
Optimization Options
-O -O2 -O3 -O0 -fno-peephole
Preprocessor Options
-C -P -Dsymbol -Usymbol -undef -dM -dN -M -MD -MG -MM -MMD
Assembler Options
-fno-short-insns -filasm-path=pathname -mjvm -fstdlib-name=name -fsave-asm
Directory Options
-Idir -nostdinc -nostdinc++
Linker Options
-e entrypoint -Ldir -nostdlib -llibrary -shared -static -m32bit-only -fresources=resfile -fculture=name -mcui-subsystem -mgui-subsystem -gtk -gnome -winforms
Other Options
-dumpversion --help -fplugin-key-path=pathname

OVERALL OPTIONS

-c
Compile or assemble the input source files to object files, but do not link. The object file corresponding to the input file `file.ext' will be called `file.obj' unless the `-o' option is supplied.

If the language compiles multiple input source files at a time, then there will be a single output file. The name of the output file will be based on the name of the first input file unless the `-o' option is supplied.

-S
Compile the input source files to produce assembly language in the Intermediate Language format. The assembly file corresponding to the input file `file.ext' will be called `file.il' unless the `-o' option is supplied.

If the language compiles multiple input source files at a time, then there will be a single output file. The name of the output file will be based on the name of the first input file unless the `-o' option is supplied.

-E
Preprocess the input files and write the preprocessed source to the output file. If no output file is supplied, then the preprocessed source is written to standard output.
-o FILE
Specify the name of the file to write the output to. The default depends upon how cscc is invoked. Specifying FILE as `-' indicates that the output should be set to standard output. Standard output can only be used for pre-processing.

If none of `-c', `-S', or `-E' are supplied, then the default output file is `a.exe' or `a.dll'. The latter is used when the `-shared' option is supplied.

-pipe
Not used at present. Provided for compatibility with gcc(1).
-v
Print verbose debugging information about the files that are being compiled.
-vv
Print the names of the command-lines that are executed by cscc to invoke external programs such as language plug-ins and the assembler, ilasm(1).
-x language
Specify the source language to use to compile all input files. This is typically not needed, because cscc can guess the language from the input file's extension.

The options `-x cs' and `-x csharp' specify that the language is C#.

See the Texinfo documentation for cscc for more information on language plugins.

Default file extensions typically follow the Windows conventions of `.obj', `.exe', and `.dll' rather than the Unix conventions of `.o', no extension, and `.so' respectively. This is due to the Windows nature of IL binaries, and to prevent confusion with native Unix binaries. The `-o' option can be used to override the defaults.

LANGUAGE OPTIONS

Every language supported by cscc has its own set of language, warning, and other options. This manpage describes the options for C# only.

-flatin1-charset
The input source file's character set is Latin-1, instead of the UTF-8 default.

If the source is in a character set other than Latin-1 or UTF-8, the programmer must arrange for it to be converted into UTF-8 prior to invoking the compiler.

-foctal-chars
The C# language standard does not support octal characters constants by default. This option is enabled by default.

If this option is enabled, sequences such as `\033' will be processed as in C, with a warning. The `-Wno-octal-chars' option can be used to disable the warning. Use the `-fno-octal-chars' option to disable the use of octal character constants.

-foctal-constants
The C# language standard does not support octal integer constants by default. Selecting this option will enable them.

If this option is not present, sequences such as `033' will be parsed as decimal, and a warning will be displayed. The `-Wno-octal-constants' or `-fdecimal-constants' options will disable the warning.

-fdecimal-constants
Parse character sequences that look like octal integers as decimal and suppress the warning. If both `-foctal-constants' and `-fdecimal-constants' are supplied, then the former takes precedence.
-fchecked, -funchecked
Compile arithmetic expressions so that overflow exceptions will or will not be thrown, respectively. The default is `-funchecked'. The `checked' and `unchecked' keywords can be used in source files to override this setting.
-fsyntax-check
Parse the input source file to check its syntax, but don't go any further with compilation.
-fsemantic-check
Parse the input source file to check its syntax and perform semantic analysis, but don't go any further with compilation.
-funsafe
Permit the use of unsafe C# language constructs in the input source file. If this option is not supplied, all unsafe constructs will result in an error.
-fhidebysig, -fhidebyname
Normally C# methods are marked as "hide by signature" so that multiple methods with the same name can be properly distinguished. Other languages (e.g. C and VB) use "hide by name", where the signature is not relevant when looking for a method. These options allow the type of method resolution to be controlled. It is mostly of use when writing libraries in C# that will be visible to non-C# applications.

WARNING OPTIONS

-Wall, -W
Enable all warnings that are supported by the compiler. Individual warnings can be disabled with `-Wno-XXX' options. For example, `-Wall -Wno-empty-input' will enable all warnings except the "empty input file" warning.
-Werror
Convert all warnings into errors.
-w
Suppress all warnings.
-Woctal-chars
Warn if the programmer uses the octal form of a character. The C# language standard only supports `\0', but this compiler also supports sequences such as `\033'.
-Woctal-constants
Warn if the programmer uses a sequence that looks like an octal integer constant, but which is being parsed as decimal in accordance with the C# language standard.
-Wunknown-escapes
Warn if an unknown escape sequence is used in a string or character constant.
-Winvalid-utf8
Warn if an invalid UTF-8 sequence is encountered in the input source file.
-Wlarge-unicode-chars
Warn if a character constant uses a Unicode character with a codepoint value greater than 65535.
-Wmulti-char-constant
Warn if a character constant contains more than one character.
-Wunsafe
Warn when an unsafe construct is used in the program.
-Wempty-input
Warn if the input source file does not contain any declarations.

DEBUGGING OPTIONS

-g
Enable the generation of debug symbol information in the output file.

OPTIMIZATION OPTIONS

-O, -O2, -O3
Enable various levels of optimization.
-O0
Disable all optimizations.
-fno-peephole
Disable peephole optimization of the code.

PREPROCESSOR OPTIONS

-C
Include comments in pre-processor output. This option is not yet supported.
-P
Don't use `#line' directives in pre-processor output.
-Dsymbol
Define the macro `symbol' prior to pre-processing the input.

C# does not support macros with values. Supplying a command-line option of `-Dsymbol=value' will result in a macro called `symbol=value', which cannot be tested effectively in C# source code.

-Usymbol
Undefine the macro `symbol' prior to pre-processing the input.
-undef
Undefine all standard macros prior to pre-processing the input.
-dM
Dump the macros that were defined in the input source instead of dumping the pre-processor output. This can only be used with the `-E' option.
-dN
Dump both the pre-processor output and the macros that were defined. This can only be used with the `-E' option.
-M, -MD, -MG, -MM, -MMD
Generate dependency information from the pre-processor (C language only).

The standard macro `__CSCC__' is defined to indicate that cscc is being used to compile the source code.

The standard macros `DEBUG' or `RELEASE' will be defined to indicate if a debug (`-g') or release version is being built.

The standard macro `__JVM__' is defined to indicate that the output is JVM code instead of IL code.

ASSEMBLER OPTIONS

-fno-short-insns
Causes the `-no-short-insns' command-line option to be passed to the ilasm(1) assembler.

This alters how the assembler generates the final object code. You typically don't need to use this option.

-filasm-path=pathname
Specifies the full pathname of the ilasm(1) assembler. By default, cscc searches for ilasm along the PATH.
-mjvm
Compile to JVM bytecode instead of IL bytecode.
-fstdlib-name=name
Change the name of the standard library to name. The default value is "mscorlib".
-fsave-asm
Do not delete intermediate assembly output files. This is useful for debugging compiler problems.

DIRECTORY OPTIONS

-Idir
Specify the name of a directory in which the compiler should search for included files.
-fnostdinc
Don't use standard include directories.
-fnostdinc++
Don't use standard C++ include directories.

These options are not currently used by the C# compiler. They are provided for future language plug-ins that may use include files.

LINKER OPTIONS

-e entrypoint
Specify the name of the entry point for the program. This may either be a class name (e.g. `MainClass') or a method name (e.g. `MainClass.Main'). If this option is not supplied, the linker will search for any class with a static method called `Main'.
-Ldir
Specify the name of a directory in which the compiler should search for libraries that the program will be linked against.
-nostdlib
Don't use standard library directories and libraries.
-llibrary
Link against the specified library. For example, specifying `-lSystem.XML' will search for the library `System.XML.dll' along the library search path.

Unless `-nostdlib' is supplied, the library `mscorlib' is implicitly assumed to always be linked against.

Libraries can also be specified by listing their filenames explicitly on the command-line. For example: `/usr/local/lib/cscc/System.XML.dll' would have the same effect as `-lSystem.XML'.

-shared
Create a shared library (.dll) instead of an executable (.exe).
-static
Link statically against the supplied libraries. This will incorporate the object file data for the libraries into the program being built.

You normally will not need to use this option, unless you are concerned that a foreign host may not have all of the libraries that are required to execute the program.

This option will never statically link against a library that has native, internalcall, or PInvoke methods. In particular, `mscorlib.dll' will never be linked statically.

-m32bit-only
Mark the final output file as only suitable to be executed on 32-bit platforms. Use of this option is severely discouraged as it makes the resultant program less portable.
-fresources=resfile
Specify the name of a resource file to be linked with the final library or executable. Multiple `-fresources' options may be used to specify multiple resource files.
-fculture=name
Specify the resource culture (e.g. "en-US").
-mcui-subsystem
Tag the output file so that it can run within the command-line subsystem under Windows. This is the default.
-mgui-subsystem
Tag the output file so that it can run within the GUI subsystem under Windows.
-gtk
Link against all of the libraries that are necessary to use Gtk#.
-gnome
Link against all of the libraries that are necessary to use Gnome#.
-winforms
Link against all of the libraries that are necessary to use WinForms.

OTHER OPTIONS

-dumpversion
Dump the version of cscc to standard error and then exit.
--help
Print a usage message about the supported options and then exit.
-fplugin-key-path=pathname
Specify the pathname of a language plug-in to be used to compile the language identified by key.

See the Texinfo documentation for cscc for more information on language plugins.

AUTHOR

Written by Southern Storm Software, Pty Ltd.

http://www.southern-storm.com.au/

SEE ALSO

HOMEPAGE

Portable.NET is part of the DotGNU project, see the homepage at http://dotgnu.org/.

DIAGNOSTICS

Exit status is 1 if an error occurred while processing the input. Otherwise the exit status is 0.