Coder Social home page Coder Social logo

Static struct about c2rust HOT 5 CLOSED

immunant avatar immunant commented on June 14, 2024
Static struct

from c2rust.

Comments (5)

ahomescu avatar ahomescu commented on June 14, 2024

We already support translating static struct initializers, and I think the real culprit here is:

#define ChCharOf(c)	((chtype)(c) & (chtype)A_CHARTEXT)
#define ChAttrOf(c)	((chtype)(c) & (chtype)A_ATTRIBUTES)
...
#define NewChar(ch)	NewChar2(ChCharOf(ch), ChAttrOf(ch))

I'll check if we support bitwise & in static initializers, I suspect that's might be the problem.

from c2rust.

TheDan64 avatar TheDan64 commented on June 14, 2024

Yeah, this seems to be one that rust won't compile in a static and so we have to initialize it in a section. We'll see if we can get this to work. I think it should be possible

from c2rust.

ahomescu avatar ahomescu commented on June 14, 2024

We have a potential fix in ad0e042, @boomshroom could you give it another try?

from c2rust.

thedataking avatar thedataking commented on June 14, 2024

@boomshroom please let us know if the issue is fixed for you so that we may close the issue.

from c2rust.

rinon avatar rinon commented on June 14, 2024

Closing for inactivity, please ping this issue if you need it re-opened.

from c2rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.