Skip to content

Don't #include standard library headers unconditionally #1095

Open
@real-or-random

Description

@real-or-random

We currently include <stdio.h> for fprintf used in the a) tests and b) in the default error callbacks ... We should not include the header unconditionally.

#include <stdio.h>

This is a problem downstream in rust-bitcoin/rust-secp256k1#421 .

edit:
We have a similar issue for stdlib.h but it is a little bit more complicated. It has abort, and malloc/free. The story for abort is the same as for fprintf. Strictly speaking one doesn't need malloc/free if one uses the prealloc interface but we don't provide consistent include headers for this. (You'll need the normal plus the prealloc header...) So people need to patch our sources which is anything but elegant. https://github.com/rust-bitcoin/rust-secp256k1/blob/master/secp256k1-sys/depend/secp256k1.c.patch

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions