Giter Club home page Giter Club logo

Comments (4)

DacoTaco avatar DacoTaco commented on July 29, 2024

im no expert, but the problem here is that the content array has no fixed length and changes between titles (as some titles have more content files than others) and this is C code, not C++ (so no access to std::vector, which in turn would increase code size too).

the only thing i can think of is to make this a pointer?
maybe @WinterMute knows something?

from libogc.

endrift avatar endrift commented on July 29, 2024

You can't do this with a pointer. A flexible array is effectively syntactic sugar for the memory past the end of the struct. Generally I don't recommend using them since their memory semantics are, well, weird (which is probably why C++ disallows them), but it's impossible to solve this in a way that placates both the C++ compiler and preserves backwards compatibility. You should probably just turn off -Wpedantic, to be honest, since at this point I think changing that API is unlikely to happen.

from libogc.

DacoTaco avatar DacoTaco commented on July 29, 2024

ye, thats fair. changing the API would sadly break to much homebrew out there. and if a pointer to replace the array won't work, then i also think turning off the warning is best.

from libogc.

techflashYT avatar techflashYT commented on July 29, 2024

Alright, I guess I'll just use pragmas to disable it temporarily for that include, even though it's a pain, that's still a better option than breaking backwards compatibility or just disabling the warning altogether, potentially breaking some of my code...

from libogc.

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.