User Tools

Site Tools


c_language:overview

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
c_language:overview [2021/09/21 10:53] – [IOCCC] utedassc_language:overview [2022/09/12 00:30] (current) – external edit 127.0.0.1
Line 9: Line 9:
   * [[https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html|Statements and Declarations in Expressions]]   * [[https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html|Statements and Declarations in Expressions]]
   * What inline in combination with export and static actually does [[https://stackoverflow.com/questions/6312597/is-inline-without-static-or-extern-ever-useful-in-c99|SO1]], [[https://stackoverflow.com/questions/216510/what-does-extern-inline-do|SO2]], [[https://en.cppreference.com/w/c/language/inline|CPP reference]]   * What inline in combination with export and static actually does [[https://stackoverflow.com/questions/6312597/is-inline-without-static-or-extern-ever-useful-in-c99|SO1]], [[https://stackoverflow.com/questions/216510/what-does-extern-inline-do|SO2]], [[https://en.cppreference.com/w/c/language/inline|CPP reference]]
 +  * [[http://www.catb.org/esr/structure-packing/]] -- The lost art of structure packing
  
 [[http://www.underhanded-c.org/|Underhanded C Contest]] [[http://www.underhanded-c.org/|Underhanded C Contest]]
Line 22: Line 23:
 [[https://stackoverflow.com/questions/1476892/poster-with-the-8-phases-of-translation-in-the-c-language/1479972#1479972|stackoverflow]] [[https://stackoverflow.com/questions/1476892/poster-with-the-8-phases-of-translation-in-the-c-language/1479972#1479972|stackoverflow]]
  
 +<code>
 +                       ANSI C translation phases
 +                       =========================
 +
 +          +-------------------------------------------------+
 +          | map physical characters to source character set |
 +          |     replace line terminators with newlines      |
 +          |           decode trigraph sequences             |
 +          +-------------------------------------------------+
 +                                   |
 +                                   V
 +               +---------------------------------------+
 +               | join lines along trailing backslashes |
 +               +---------------------------------------+
 +                                   |
 +                                   V
 +     +-------------------------------------------------------------+
 +     | decompose into preprocessing tokens and whitespace/comments |
 +                          strip comments                         |
 +                          retain newlines                        |
 +     +-------------------------------------------------------------+        
 +                                   |
 +                                   V
 +          +------------------------------------------------+
 +          | execute preprocessing directives/invoke macros |
 +          |              process included files            |
 +          +------------------------------------------------+
 +                                   |
 +                                   V
 +   +----------------------------------------------------------------+
 +   | decode escape sequences in character constants/string literals |
 +   +----------------------------------------------------------------+
 +                                   |
 +                                   V
 +                +--------------------------------------+
 +                | concatenate adjacent string literals |
 +                +--------------------------------------+
 +                                   |
 +                                   V
 +              +------------------------------------------+
 +              | convert preprocessing tokens to C tokens |
 +              |       analyze and translate tokens       |
 +              +------------------------------------------+
 +                                   |
 +                                   V
 +                    +-----------------------------+
 +                    | resolve external references |
 +                    |        link libraries       |
 +                    |      build program image    |
 +                    +-----------------------------+
 +</code>
 ====== Right-to-left rule ====== ====== Right-to-left rule ======
 [[https://stackoverflow.com/questions/8392228/complicated-right-to-left-rule-when-defining-a-variable|SO thread]] [[https://stackoverflow.com/questions/8392228/complicated-right-to-left-rule-when-defining-a-variable|SO thread]]
c_language/overview.1632221616.txt.gz · Last modified: 2022/09/12 00:30 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki