*/ } ul /* Whole unordered list */ { } ul li /* Unordered list item */ { } ol /* Whole ordered list */ { } ol li /* Ordered list item */ { } hr {} /* ---- Some span elements --- */ sub /* Subscripts. Pandoc: H~2~O */ { } sup /* Superscripts. Pandoc: The 2^nd^ try. */ { } em /* Emphasis. Markdown: *emphasis* or _emphasis_ */ { } em > em /* Emphasis within emphasis: *This is all *emphasized* except that* */ { font-style: normal; } blockquote > p > em /* Emphasis within emphasis: *This is all *emphasized* except that* */ { font-style: normal; } blockquote > * > p > em /* Emphasis within emphasis: *This is all *emphasized* except that* */ { font-style: normal; } blockquote > p > ins > em /* Emphasis within emphasis: *This is all *emphasized* except that* */ { font-style: normal; } blockquote > * > p > ins > em /* Emphasis within emphasis: *This is all *emphasized* except that* */ { font-style: normal; } /* ---- Links (anchors) ---- */ a /* All links */ { /* Keep links clean. On screen, they are colored; in print, they do nothing anyway. */ text-decoration: none; } @media screen { a:hover { /* On hover, we indicate a bit more that it is a link. */ text-decoration: underline; } } @media print { a { /* In print, a colored link is useless, so un-style it. */ color: black; background: transparent; } a[href^="http://"]:after, a[href^="https://"]:after { /* However, links that go somewhere else, might be useful to the reader, so for http and https links, print the URL after what was the link text in parens */ content: " (" attr(href) ") "; font-size: 90%; } } /* ---- Images ---- */ img { /* Let it be inline left/right where it wants to be, but verticality make it in the middle to look nicer, but opinions differ, and if in a multi-line paragraph, it might not be so great. */ vertical-align: middle; } div.figure /* Pandoc figure-style image */ { /* Center the image and caption */ margin-left: auto; margin-right: auto; text-align: center; font-style: italic; } p.caption /* Pandoc figure-style caption within div.figure */ { /* Inherits div.figure props by default */ } /* ---- Code blocks and spans ---- */ pre, code { background-color: #fdf7ee; /* BEGIN word wrap */ /* Need all the following to word wrap instead of scroll box */ /* This will override the overflow:auto if present */ white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ /* END word wrap */ } pre /* Code blocks */ { /* Distinguish pre blocks from other text by more than the font with a background tint. */ padding: 0.5em; /* Since we have a background color */ border-radius: 5px; /* Softens it */ /* Give it a some definition */ border: 1px solid #aaa; /* Set it off left and right, seems to look a bit nicer when we have a background */ margin-left: 0.5em; margin-right: 0.5em; } pre.yacc, code.yacc { background-color: #f0f0f0; } pre.yacc /* Code blocks */ { /* Distinguish pre blocks from other text by more than the font with a background tint. */ padding: 0.0em; /* Since we have a background color */ border-radius: 5px; /* Softens it */ /* Give it a some definition */ border: 0px solid #aaa; /* Set it off left and right, seems to look a bit nicer when we have a background */ margin-left: 0.0em; margin-right: 0.0em; } @media screen { pre { white-space: pre; /* Dotted looks better on screen and solid seems to print better. */ border: 1px dotted #777; } } code /* All inline code spans */ { } p > code, li > code /* Code spans in paragraphs and tight lists */ { /* Pad a little from adjacent text */ padding-left: 2px; padding-right: 2px; } li > p code /* Code span in a loose list */ { /* We have room for some more background color above and below */ padding: 2px; } span.option { color: blue; text-decoration: underline; } /* ---- Math ---- */ span.math /* Pandoc inline math default and --jsmath inline math */ { /* Tried font-style:italic here, and it messed up MathJax rendering in some browsers. Maybe don't mess with at all. */ } div.math /* Pandoc --jsmath display math */ { } span.LaTeX /* Pandoc --latexmathml math */ { } eq /* Pandoc --gladtex math */ { } /* ---- Tables ---- */ /* A clean textbook-like style with horizontal lines above and below and under the header. Rows highlight on hover to help scanning the table on screen. */ table { border-collapse: collapse; border-spacing: 0; /* IE 6 */ border-bottom: 2pt solid #000; border-top: 2pt solid #000; /* The caption on top will not have a bottom-border */ /* Center */ margin-left: auto; margin-right: auto; } thead /* Entire table header */ { border-bottom: 1pt solid #000; background-color: #eee; /* Does this BG print well? */ } tr.header /* Each header row */ { } tbody /* Entire table body */ { } /* Table body rows */ tr { } tr.odd:hover, tr.even:hover /* Use .odd and .even classes to avoid styling rows in other tables */ { background-color: #eee; } /* Odd and even rows */ tr.odd {} tr.even {} td, th /* Table cells and table header cells */ { vertical-align: top; /* Word */ vertical-align: baseline; /* Others */ padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.2em; padding-bottom: 0.2em; } /* Removes padding on left and right of table for a tight look. Good if thead has no background color*/ /* tr td:last-child, tr th:last-child { padding-right: 0; } tr td:first-child, tr th:first-child { padding-left: 0; } */ th /* Table header cells */ { font-weight: bold; } tfoot /* Table footer (what appears here if caption is on top?) */ { } caption /* This is for a table caption tag, not the p.caption Pandoc uses in a div.figure */ { caption-side: top; border: none; font-size: 0.9em; font-style: italic; text-align: center; margin-bottom: 0.3em; /* Good for when on top */ padding-bottom: 0.2em; } /* ---- Definition lists ---- */ dl /* The whole list */ { border-top: 2pt solid black; padding-top: 0.5em; border-bottom: 2pt solid black; } dt /* Definition term */ { font-weight: bold; } dd+dt /* 2nd or greater term in the list */ { border-top: 1pt solid black; padding-top: 0.5em; } dd /* A definition */ { margin-bottom: 0.5em; } dd+dd /* 2nd or greater definition of a term */ { border-top: 1px solid black; /* To separate multiple definitions */ } /* ---- Footnotes ---- */ a.footnote, a.footnoteRef { /* Pandoc, MultiMarkdown footnote links */ font-size: small; vertical-align: text-top; } a[href^="#fnref"], a.reversefootnote /* Pandoc, MultiMarkdown, ?? footnote back links */ { } @media print { a[href^="#fnref"], a.reversefootnote /* Pandoc, MultiMarkdown */ { /* Don't display these at all in print since the arrow is only something to click on */ display: none; } } div.footnotes /* Pandoc footnotes div at end of the document */ { } div.footnotes li[id^="fn"] /* A footnote item within that div */ { } table tr td,th { border-right: 1px solid; border-left: 1px solid; } /* You can class stuff as "noprint" to not print. Useful since you can't set this media conditional inside an HTML element's style attribute (I think), and you don't want to make another stylesheet that imports this one and adds a class just to do this. */ @media print { .noprint { display:none; } }
2025-05-28
integration into IS ISO/IEC 9899:202y
document number | date | comment |
---|---|---|
n3557 | 202505 | this document |
The choice that function designators decay to function pointer inside
function call expressions seems to have been made to facilitate the
description of function call operators and to ensure that the model
corresponded to the low level jump instructions with a target label. The
times that this model sufficiently describes modern compilation
techniques are long past; inlining (with or without the inline
keyword),
specialization and link-time optimization regularly push this model to
its limits.
Recently WG14 has accepted N3517, Array subscripting without decay, for C2y and this paper here attempts to change the text for function call expressions in the same spirit. Luckily, the implications for function calls are much less than for array subscripting, so we hope that we will easier get consensus.
Nevertheless we think that it is important to make that step, such that other changes that might come later during development of C2y can be integrated more easily. This concerns in particular
generalizations of the properties of register
to file
scope (and maybe to static
in block
scope), namely an annotation that inhibits or regulates possible
aliasing between identifiers with linkage (such as gcc’s visibility
attribute) or static storage
duration.
the extension of constexpr
to
functions.
The current wording describes the constraints on the leading operand of a function call operator with
shall have type pointer to function returning
void
or returning a complete object type other than an array type
and then later wiggles around this description all over the text. Adding “function type” to this lengthy description in all places would make the text almost unreadable. Therefore we propose to do some housekeeping at the same time and to reorganize the text such that its intent becomes clearer.
No change of semantics is intended.
Unfortunately that housekeeping also implies certain reordering of paragraphs. We try to address this reorganization as readable as possible.
New text is underlined green, removed text is
stroke-out red. Reorganization of the paragraphs is indicated
in the running text, Xª refers to new paragraph numbers, pX to
current numbers.
6.3.3.1 Lvalues, arrays, and function designators
…
p3 A function designator is an expression that has function type. Except when it is the operand of the
sizeof
operator,56) a typeof operator,orthe unary&
operator, or the leading operand of a function call operator, a function designator with type “function returning type” is converted to an expression that has type “pointer to function returning type”.
6.5.3.3 Function calls
Move paragraph p3 up front, since it is purely descriptive.
Description
1ª A postfix expression followed by parentheses
()
containing a possibly empty, comma-separated list of assignment expressions is a function call. Thepostfix expressionleading operand denotes the called function. Thelist of expressions specifiesother operands, if any, specify the arguments to the function call.
Constraints
Now come p1 and p2 combined together, including the new case that the function is just denoted by a function descriptor. Introducing a type FT for the specified function type alleviates the text.
2ª The
expression that denotes the called function91)leading operand shall havetype pointer to functionfunction type or be a pointer to such a function type. This function type FT shall be returningvoid
or be returning a complete object type other than an array type.The number of arguments shall agree with the number of parameters of FT. Each argument shall have a type such that its value may be assigned to an object with the unqualified version of the type of its corresponding parameter.
p2
91) Most often, this is the result of converting an identifier that is a function designator.
Semantics
Previously p7 and p5. These can be compacted by clearly refering to FT instead of beating around the bush.
3ª If the called function is defined with a type that is not compatible with
the type (of the expression) pointed to by the expression that denotes the called functionFT, the behavior is undefined.If
p5the expression that denotes the called function has type pointer to functionFT is returningana complete object type, the function callexpressionhas the same type as that object type, and has the value determined as specified in 6.8.6.4. Otherwise, the function call has typevoid
.
Previously p4 and p6 are combined and can be shortened, too.
4ª
An argument can be an expression of any complete object type.In preparing for the call to the function, the arguments are evaluated, andeach parameter is assigned the value of the corresponding argument
p6 The argumentsthe resulting values are implicitly converted, as if by assignment, to the types of the corresponding parameters, taking the type of each parameter to be the unqualified version of its declared type.92) The ellipsis notation in a variadic function declarator (6.7.7.4) causes argument type conversion to stop after the last declared parameter, if present. The integer promotions are performed on each trailing argument, and trailing arguments that have typefloat
are promoted todouble
. These are called the default argument promotions. No other conversions are performed implicitly.
92) A function can change the values of its parameters, but these changes cannot
affect the values of themodify lvalues that are used as arguments. On the other hand, it is possible to pass a pointer to an object, and the function can then change the value of the object pointed to. A parameter declared to have array or function type is adjusted to have a pointer type as described in 6.7.7.4
Prefer to speak of operands. Also the same thing (execution of the called function) was addressed with two different terms within the same paragraph; chose one and stick to it.
5ª There is a sequence point after the evaluations of all operands (the function designator and the
actualarguments) but before theactual callexecution of the called function. Every evaluation in the calling function (including other function calls) that is not otherwise specifically sequenced before or after the execution of the body of the called function is indeterminately sequenced with respect to the execution of the called function.93)
93) In other words, function executions do not interleave with each other.
Then terminate with p9 and p10 unchanged.
6ª Recursive function calls shall be permitted, both directly and indirectly through any chain of other functions.
7ª EXAMPLE …
C .1 Known Sequence Points
Update the first bullet point
- Between the evaluations of
the function designator and actual arguments inall operands (the function designator and the arguments) of a function call and theactual callexecution of the called function. (6.5.3.3).