Comments (5)
Error is different since 5b2bcaf:
struct s { int i; }
thread 'main' panicked at 'not yet implemented: struct and union members', src/parse/decl.rs:578:9
from saltwater.
Enums are done since ddc165c!
from saltwater.
Struct and union declarations are done since 44a13ce. Need to implement expressions and codegen.
struct s { int i; } s;
int main() {
return s.i;
}
thread 'main' panicked at 'not yet implemented: struct and union members are very much not implemented', src/parse/expr.rs:706:33
from saltwater.
Possible ways to implement this:
Have a cache in ir::LLVMCompiler
that stores offsets into structs. For unions, the offset is always zero. The size of a struct is the greatest offset + sizeof(member at that offset). Accessing a struct member is fetching *(s + offset).
Ways to calculate the offset: For now, just do sizeof(member) + (8-sizeof(member))%8, i.e. round up to the nearest multiple of the alignment.
In the future, sort members from largest size to smallest, excluding arrays. Put chars, shorts in spare bytes. Prohibited by the C standard, see section 6.7.2.1.
from saltwater.
Done in 01f53f2!!!
from saltwater.
Related Issues (20)
- Space between function macro name and args HOT 2
- Do not report type error when one type is "<type error>" HOT 1
- Show macro expansions for undeclared identifiers HOT 5
- Cross-check rcc against other compilers HOT 3
- Incomplete function macro call should be an error
- [ICE] bug in parser: loaded a variable that was not declared HOT 1
- Get rid of unput in lexer HOT 1
- Get rid of seen_line_token
- Hexadecimal floating constant requires an exponent HOT 3
- Optional whitespace between command line argument key and value HOT 1
- [ICE] Newline in string
- [ICE] Macro expansion assertion failed HOT 3
- Add tests for command line arguments HOT 4
- Link object files when passed in instead of source files
- Pre-increment on pointer to struct causes error
- Generate man pages using help2man HOT 4
- ## is not implemented HOT 10
- Switch from shared_str to arcstr
- The order of preprocessor stringifying is wrong. HOT 1
- ArgumentExtension is not set for AbiParam
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from saltwater.