GithubHelp home page GithubHelp logo

Use type-generic macros about ch55xduino HOT 8 CLOSED

deqingsun avatar deqingsun commented on July 20, 2024
Use type-generic macros

from ch55xduino.

Comments (8)

DeqingSun avatar DeqingSun commented on July 20, 2024

@leo60228 thanks for this info. I'll check if this can be implemented into the package.

from ch55xduino.

DeqingSun avatar DeqingSun commented on July 20, 2024

@leo60228 Frankly speaking I have no idea what "_Generic" means or how it compiles (yet). But it seems work. I'll see how to add it into the package.

Screen Shot 2021-09-29 at 9 07 01 AM

from ch55xduino.

leo60228 avatar leo60228 commented on July 20, 2024

_Generic is a relatively new feature (C99 had polymorphic functions in the standard library, but those were implemented in a compiler-specific way until C11). SDCC supports it but there's several open bugs. I don't think it's usable for print yet, but it could be with some bugfixes, and might be useful for other functions.

from ch55xduino.

DeqingSun avatar DeqingSun commented on July 20, 2024

@leo60228 Sorry I ask the question before I learn some basics about _Generic. Why you think it is not usable for print? It seems my sketch compiles and works as expected.

from ch55xduino.

leo60228 avatar leo60228 commented on July 20, 2024

from ch55xduino.

DeqingSun avatar DeqingSun commented on July 20, 2024

@leo60228 Thank you and I get it when trying to use the pointer.

Internal error: validateLink failed in SPEC_NOUN(type) @ /Users/sdcc-builder/build/sdcc-build/orig/sdcc/src/SDCCast.c:5401: expected SPECIFIER, got DECLARATOR

I'll subscribe to that ticket and see when it get fixed. Not supporting pointer makes implementing the _Generic to print pointless.

from ch55xduino.

DeqingSun avatar DeqingSun commented on July 20, 2024

Update: The bug fixing is now funded. Wish it get fixed soon

https://sourceforge.net/p/sdcc/wiki/SDCC-STD-UX/

from ch55xduino.

DeqingSun avatar DeqingSun commented on July 20, 2024

Generic is functional after SDCC commit 13402.

This repo now supports Generic for print.

https://github.com/DeqingSun/ch55xduino/blob/ch55xduino/ch55xduino/ch55x/cores/ch55xduino/genericPrintSelection.h

from ch55xduino.

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.