aboutsummaryrefslogtreecommitdiff
path: root/decl.c
AgeCommit message (Collapse)Author
2021-08-15decl: Don't accept abstract function declarator when disallowedMichael Forney
When declarator() is called with allowabstract == false, the caller can assume that it will always return the identifier being declared. However, abstract function declarators were incorrectly accepted in this case with name set to NULL instead of erroring out due to invalid syntax. To fix this, only skip forward to function declarator parsing for abstract declarators, since this is the only case where we can't immediately tell whether we have a parenthesized declarator or a function declarator. Fixes #74.
2021-07-02qbe: Remove repr from struct value and use per-instruction class insteadMichael Forney
This way we avoid leaking backend-specific details of type representation outside qbe.c. It also facilitates some future simplifications.
2021-07-01decl: Check that the flexible array member (if present) is lastMichael Forney
2021-07-01decl: Disallow members with incomplete typesMichael Forney
Make an exception for flexible array members, though we should also check that the flexible array member, if any, is last.
2021-07-01decl: Check that struct/union has at least one memberMichael Forney
2021-06-28Add stringconcat function to concatenate adjacent string literalsMichael Forney
This function also ensures that the string prefixes (if any) are compatible. It should make it easier to implement wide string support.
2021-04-11decl: Allow _Static_assert in struct declarationMichael Forney
2021-04-11decl: Allow _Alignas(0)Michael Forney
C11 6.7.5p6 says "An alignment specification of zero has no effect".
2020-06-03Revert "decl: Allow out-of-range enum constants when they don't change type"Michael Forney
This reverts commit 6229709b8ae21d7722fef48ad8a9f2f10b900030. I still don't understand how out-of-range enum constants are supposed to work.
2020-06-03decl: Allow out-of-range enum constants when they don't change typeMichael Forney
gcc and clang allow enum constants out of range of int, but this means that the type of enumerator may differ inside and outside the enum specifier. Instead, only allow out-of-range enum constants when their types are compatible with the final enum type.
2020-06-02decl: Improve error message for out-of-range enum constantsMichael Forney
2020-03-16decl: Simplify struct tag parsing slightlyMichael Forney
2020-01-30decl: Better check for inline definitionsMichael Forney
2020-01-30decl: Use list link to determine presence in tentative definition listMichael Forney
2019-11-19decl: Parse array size as an assignment-expressionMichael Forney
Even though we don't support VLAs yet, we should still be parsing the VLA syntax, then failing after if it was not a constant expression.
2019-08-13decl: Allow _Static_assert with no messageMichael Forney
This is accepted for C2X[0]. [0] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2265.pdf
2019-08-13decl: Separate _Static_assert handling to its own functionMichael Forney
2019-08-11decl: Allow enumerator values up to UINT_MAXMichael Forney
2019-07-10decl: Display message when _Static_assert failsMichael Forney
2019-06-18decl: _Thread_local is not yet supportedMichael Forney
2019-06-04Fix non-adjacent bit-fieldsMichael Forney
2019-06-02decl: Disallow enumerator values that aren't representable as 'int'Michael Forney
2019-05-19decl: Allow zero length arraysMichael Forney
gcc allows this, and glibc uses it in some headers instead of flexible array members.
2019-05-18decl: Give a better error message when a VLA is usedMichael Forney
2019-05-16decl: Qualifiers of array type are for element typeMichael Forney
2019-05-16decl: extern storage class with initializer is still a definitionMichael Forney
2019-05-15Implement asm labelsMichael Forney
2019-05-15decl: Don't emit function if inline is specified without static or externMichael Forney
This partially addresses #42. Now, no duplicate definitions will be emitted, but we also don't emit a definition when a later declaration is specified with extern.
2019-05-14Use correct terminology in error messageMichael Forney
2019-05-14decl: Factor out some code common to function and object declarationsMichael Forney
2019-05-12Improve error message and simplify slightlyMichael Forney
2019-04-27Unnamed bit-fields don't contribute to size or alignment of unions, or size ↵Michael Forney
of structs
2019-04-27Fix some function declarator corner casesMichael Forney
2019-04-24Use a common member for expression baseMichael Forney
2019-04-24Free functions when we're done with themMichael Forney
2019-04-24Disallow struct members with function typeMichael Forney
2019-04-21Keep track of type properties in typeMichael Forney
2019-04-20Make basic types have their own kindMichael Forney
2019-04-20Shorten some names with 'long'Michael Forney
2019-04-17Merge map.h and tree.h into util.hMichael Forney
2019-04-17Just use a single mapkey functionMichael Forney
2019-04-17htab -> mapMichael Forney
2019-04-17Fix bit-field offsets in unionsMichael Forney
2019-04-17Implement bit-field initializersMichael Forney
2019-04-16Use undecayed type in __typeof__Michael Forney
2019-04-15Silence gcc warningMichael Forney
2019-04-15decl: Fix uninitialized access with unnamed bit-fieldsMichael Forney
2019-04-14decl: Make signedness of enum types match gccMichael Forney
2019-04-13decl: Allow `register` in old-style parameter declarationsMichael Forney
2019-04-06Simplify a couple loopsMichael Forney