News for hackers. Stuff that matters.
Re:Simple Dynamic Strings library for C, compatible with nul... by pantalaimon on Tuesday December 03, 2019 @12:11PM (#21694234)
> Considering this is C, there is no way to prevent this easily since you can't express a type that is one-way convertible (i.e. sds -> char* ok, char* -> sds not ok).

    typedef struct {
        char *s;
    } sds_t;
will produce an error if you try to pass a char* instead. http://codepad.org/CmrskN9n

There are no comments on this comment yet.