The mapping of physical source file multi byte

Info icon This preview shows pages 56–58. Sign up to view the full content.

View Full Document Right Arrow Icon
The mapping of physical source file multi-byte characters to the execution character set. The input character set can be specified using the ‘ -finput-charset ’ option, while the execution character set may be controlled using the ‘ -fexec-charset ’ and -fwide-exec-charset ’ options. Identifier characters. The C and C ++ standards allow identifiers to be composed of ‘ _ ’ and the alphanumeric characters. C ++ and C99 also allow universal character names, and C99 further permits implementation-defined characters. GCC currently only permits universal character names if ‘ -fextended-identifiers ’ is used, because the implementation of universal character names in identifiers is experimental. GCC allows the ‘ $ ’ character in identifiers as an extension for most targets. This is true regardless of the ‘ std= ’ switch, since this extension cannot conflict with standards- conforming programs. When preprocessing assembler, however, dollars are not identi- fier characters by default. Currently the targets that by default do not permit ‘ $ ’ are AVR, IP2K, MMIX, MIPS Irix 3, ARM aout, and PowerPC targets for the AIX operating system. You can override the default with -fdollars-in-identifiers or fno-dollars-in-identifiers ’. See [fdollars-in-identifiers], page 63 . Non-empty sequences of whitespace characters. In textual output, each whitespace sequence is collapsed to a single space. For aesthetic reasons, the first token on each non-directive line of output is preceded with sufficient spaces that it appears in the same column as it did in the original source file. The numeric value of character constants in preprocessor expressions. The preprocessor and compiler interpret character constants in the same way; i.e. escape sequences such as ‘ \a ’ are given the values they would have on the target machine. The compiler evaluates a multi-character character constant a character at a time, shifting the previous value left by the number of bits per target character, and then or- ing in the bit-pattern of the new character truncated to the width of a target character. The final bit-pattern is given type int , and is therefore signed, regardless of whether single characters are signed or not (a slight change from versions 3.1 and earlier of GCC). If there are more characters in the constant than would fit in the target int the compiler issues a warning, and the excess leading characters are ignored. For example, ’ab’ for a target with an 8-bit char would be interpreted as (int) ((unsigned char) ’a’ * 256 + (unsigned char) ’b’) ’, and ’\234a’ as (int) ((unsigned char) ’\234’ * 256 + (unsigned char) ’a’) ’. Source file inclusion. For a discussion on how the preprocessor locates header files, Section 2.2 [Include Operation], page 8 .
Image of page 56

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Chapter 11: Implementation Details 53 Interpretation of the filename resulting from a macro-expanded ‘ #include ’ directive.
Image of page 57
Image of page 58
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern