Comments (5)
In this case I can combine the declarations and leave it as is. This would be more tricky though:
for(int i = 1, *j = 0; i < 5; ++i)
In D you have to put one of them outside the for loop.
from ctod.
The original case is fixed by 58a9e1a since both variables have the same type.
The mixed type example I posted still fails though.
from ctod.
Yeah, the pointer/int combo might be something that is so rare that maybe isn't worth fretting over.
from ctod.
One thing nice to have probably is a list of things that do not translate well, and how to deal with them.
from ctod.
Related Issues (20)
- ifndef with else results in bad version construct HOT 2
- offsetof should be translated HOT 1
- Distinguish struct / array initializers HOT 5
- Add missing pointer casts to allocating functions HOT 1
- incorrect sizeof translation HOT 2
- Struct members that are floating point or char should be default initialized to zero HOT 1
- Gets Stuck In A Loop HOT 3
- C code seems to have degenerate parsing time for some construct HOT 3
- lib-tree-sitter-src/makefile is empty HOT 2
- What to do with linkage definitions? HOT 4
- ifndef with definition HOT 1
- `typedef enum { ... } E;` should provide aliases for values HOT 5
- if(arr[idx] == val) adds the .ptr HOT 1
- Sometimes structs aren't being copied HOT 2
- unsigned without extra type doesn't get copied properly HOT 1
- Usage of struct tag results in odd translation HOT 7
- using sizeof with multiplication causes confusion HOT 4
- Nice to have: initialization of static arrays of builtin types HOT 3
- adding integer to C array HOT 4
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 ctod.