https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69202
Bug ID: 69202
Summary: semicolon at end of expression statement
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: timeraider at gmx dot at
Target Milestone: ---
Target: x86
Expression statements consist of an optional expression and a semicolon at the
end, according to the C standard.
Compound statements in expressions are a gcc extension. The site
<url>https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html</url> states that
"The last thing in the compound statement should be an expression followed by a
semicolon". But when looking into the header file
'./arch/x86/include/asm/pgtable_types.h' of the Linux kernel (version 4.1) the
following source code can be found
static inline pmd_t native_make_pmd(pmdval_t val)
{
return (pmd_t) { val };
}
which has no semicolon after val. But there are no parsing errors shown for
this file. Is the documentation wrong here or the implementation?