### /Sd Compiler Option

Syntax: | Default:
/Sd[+|-] | /Sd-

Use /Sd to set the default file extension to .c. Any file without an extension is then assumed to be a C source file, and will be compiled and linked.

By default, you must specify the extension for a source file, for example:

        icc  anthony.c

        icc  efrem.cpp

If you omit the extension, IBM C and C++ Compilers assumes that the file is an object file (.obj) and does not compile it, but only invokes the linker. The following commands are equivalent (assuming that /Sd+ has not been set elsewhere, such as in the ICC environment variable):

        icc  dale

        icc  dale.obj

        icc  /Sd- dale

If you want the default file extension to be the default source file extension, use the /Sd+ option. For example, the following two commands are equivalent:

        icc  alistair.c

        icc  /Sd+ alistair

Note:

> The /Tc and /Tp options override the setting of /Sd. If you specify /Tc or /Tp followed by a filename without an extension, the compiler looks for the name specified, without an extension, and treats the file as a C file if /Tc was specified or a C++ file if /Tp was specified. For example, given the following command:

>         icc  /Tp xiaohu

> the compiler searches for the file xiaohu and compiles it as a C++ file.

Summary of Compiler Options