Skip to content

Zephyr SDK's newlib doesn't support long long specifiers in printf  #62

@pfalcon

Description

@pfalcon

In a Zephyr application with CONFIG_NEWLIB_LIBC, I'm doing printf("%lld\n", foo); and get ld as output. Ditto for "%llu".

According to https://stackoverflow.com/a/32949522/496009, newlib's long long printf support is disabled by default, and must be enabled with --enable-newlib-io-long-long option to configure.

We should consider whether we want to enable that. But not having support for 64-bit value printing is weird.

(Report is based on samples/net/sockets/sntp_client's usage of LOG_DBG("time: %lld", epoch_time);. That doesn't work (what's printed is time: ERR). Heck, even printf("%lld") doesn't work.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions