• Keine Ergebnisse gefunden

Chapter 5 Work Bench

6.3 Starting Method

6.3.1 Startup Format

General form of command line

gcc33 ^ [<Startup option>] ^ [<file name>]

^ denotes a space.

[ ] indicates the possibility to omit.

<file name>: Specify C source file name(s) including the extension (.c).

Operations on work bench

Select startup options and source file(s), then click the [GCC33] button.

Multiple source files can be specified in a command line. All files can be processed at the same time. Although the wb33 also allows multiple files to be selected, it executes the gcc33 as many times as the number of files selected.

6.3.2 Startup Options

The gcc33 comes provided with the following 11 types of startup options:

-S

Function: Output of assembly code Specification on wb33: None (always specified)

Explanation: • This switch is used to output an assembly source file.

• This option must always be specified. If the gcc33 is started up without this option, it only displays Usage, and does not compile the source file.

-B<path name>\

Function: Compiler's path specification Specification on wb33: None (unnecessary)

Explanation: • Specify the directory where the compiler proper cc1.exe and the C preprocessor cpp.exe exist.

• For <path name>, input a relative or an absolute path immediately following -B, then enter a back slash (\) at the end of the name.

• If the directory where the compiler proper and the C preprocessor exist is registered in environment variable GCC_EXEC_PREFIX or PATH, the -B switch is unnecessary.

The priority is the -B switch, GCC_EXEC_PREFIX, and PATH, in that order.

GCC_EXEC_PREFIX must be registered in the same format of relative or absolute path and a \ as required for the -B switch.

• If the -B switch and GCC_EXEC_PREFIX are nonexistent, the directory specified by PATH or the current directory is assumed.

-E

Function: Execution of C preprocessor only Specification on wb33: None

Explanation: • Only the C preprocessor is executed in the specified C source file, and the results are output to the standard output device.

CHAPTER 6: C COMPILER

-I<path name>

Function: Specification of a directory that contains the include files Specification on wb33: Check [include path] and choose a directory from the list box.

Explanation: • Specify the directory that contains the files included in the C source.

• Input <path name> immediately after -I.

• Multiple directories can be specified. In this case, input as many instances of -I<path name> as necessary. The include files are searched in the order they appear in the command line.

• If the directory is registered in environment variable C_INCLUDE_PATH, the -I switch is unnecessary.

• File search is performed in order of priorities, i.e., current directory, -I switch, and C_INCLUDE_PATH in that order.

-D<macro name>[=<replacement character>]

Function: Definition of a macro name

Specification on wb33: Check [define] and input a macro name in the text box.

Explanation: • Define a macro name. This option functions in the same way as #define. If there is

=<replacement character> specified, define its value in the macro. If not specified, the value of the macro is set to 1.

• Input <macro name>[=<replacement character>] immediately after -D.

• Multiple macro names can be specified. In this case, input as many instances of -D<macro name>[=<replacement character>] as necessary. For the wb33, separate each instance of <macro name>[=<replacement character>] with a comma (,) as you input them.

-O, -O2, -O3

Function: Specification of optimization Specification on wb33: Check one of [NO], [O], [O2] or [O3].

Explanation: • Specify one of the four switches to perform optimized processing. When generating code, the compiler optimizes it by placing emphasis on code efficiency and speed (mainly code efficiency).

• If no switch is specified or [NO] is selected for the wb33, code optimization is not performed.

• The greater the value of -O, the higher the code efficiency. However, there is a greater possibility of causing a problem, such as absence of some debugging information in the output. If optimization cannot be executed normally, reduce the value of optimization. Normally, -O should be specified.

• :KHQDQRSWLPL]DWLRQLVVSHFLILHGWKHFRPSLOHUUHXVHVWKHYDOXHORDGHGIURPWKHPHPRU\

WRWKHUHJLVWHUWRUHGXFHPHPRU\UHDGZULWHRSHUDWLRQV6RVRPHWLPHVWKHPHPRU\PD\

QRWEHDFFHVVHG7RDYRLGWKLVVLWXDWLRQWDNHPHDVXUHVDVVKRZQEHORZ - Declare variables with "volatile". Example) volatile char IO_port1;

- Do not specify the optimization.

- Use "-fvolatile". Pointers are accessed as volatile objects.

Use "-fvolatile-global". External variables are all accessed as volatile objects.

-g

Function: Addition of debugging information Specification on wb33: Check [debug info].

Explanation: • Creates an output file containing debugging information.

• Always specify this option when you perform the C source level debugging.

• Refer to Section 6.6 for debugging information.

-mno-memcopy

Function: Inline expansion of strcpy and memcpy function calls Specification on wb33: Check [inline memcpy].

Explanation: • The strcpy and memcpy function calls are expanded in-line.

CHAPTER 6: C COMPILER

E0C33 FAMILY EPSON 81

-fno-builtin

Function: Inline expansion of the fabs function call Specification on wb33: Check [inline fabs].

Explanation: • The fabs function is not expanded inline. Calling fabs is faster.

-merr

Function: Output of error files Specification on wb33: Non

Explanation: • Delivers in a file (gcc33.err) the contents that are output by the gcc33 via the Standard Output (stdout), such as error messages.

• When this option is specified, messages do not appear on the screen.

When entering options in the command line, you need to place one or more spaces before and after the option.

Example: c:\cc33\gcc33 -S -Bc:\user\local\bin\ -O -g test.c

CHAPTER 6: C COMPILER

6.4 Messages

The gcc33 delivers its messages through the Standard Output (stdout).

If the gcc33 is started up by using the wb33's [GCC33] button, the message is output to "wb33.err". When execution is completed, a message is displayed in the output window (default).

End message

The gcc33 outputs only the following end message when it ends normally.

%QORKNG%QORNGVGF Usage output

If no file name was specified or an option was not specified correctly, the gcc33 ends after delivering the following message concerning the usage:

%\%%\IEE

)07%%QORKNGTHQT'%8GT4GXZZZ 7UCIG

IEE5=QRVKQPU?HKNGPCOG 1RVKQPU

IIGPGTCVGFGDWIKPHQTOCVKQP 1QRVKOK\GQWVRWVEQFG

'RTGRTQEGUUUQWTEGHKNGUCPFQWVRWVVJGTGUWNVUVQUVFQWV

$FKTGEVQT[ \URGEKHKGUVJGFKTGEVQ[YJKEJEEGZGCPFERRGZGGZKV +FKTGEVQT[ URGEKHKGUVJGFKTGEVQ[YJKEJKPENWFGHKNGUGZKUV

&OCETQFGHP FGHKPGOCETQOCETQCUFGHP

&OCETQ FGHKPGOCETQOCETQCU OGTT RTQFWEGNQIHKNGIEEGTT

OPQOGOER[ RTQFWEGUVTKPIXCTKCDNGKPKVKCNK\GTUVCVGOGPVKPNKPG 1WVRWV

'ZVGPFGFCUUGODNGTUQWTEGHKNGURUHQTGZV 'ZCORNG

IEE5$E\WUT\NQECN\DKP\1IVGUVE When error/warning occurs

If an error or a warning is produced, an error/warning message will appear before the end message shows up.

In the case of an error, the gcc33 ends without creating an output file.

In the case of a warning, the gcc33 ends after creating an output file. However, the output file cannot be guaranteed to work properly.

CHAPTER 6: C COMPILER

E0C33 FAMILY EPSON 83