Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/cborpretty.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
#include "compilersupport_p.h"
#include "utf8_p.h"

// Include sys/types.h before inttypes.h to work around issue with
// certain versions of GCC and newlib which causes omission of PRIx64
Comment on lines +32 to +33

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment wasn't necessary. But I'll allow it.

However, is this high enough? Imagine something changes in the headers above and breaks? Especially cbor.h, which includes stdint.h.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late reply. Your comment did have me give an other thought about this problem, and came to the conclusion that instead of implementing a work around for a specific compiler instead you should use a working compiler. So instead of using this fix/workaround I changed my docker image used to compile my program in CI/CD pipeline. So will close this pull request, if other have this problem this is my used dockerbuild definition used wit gitlab.

FROM ubuntu:26.04

ENV DEBIAN_FRONTEND=noninteractive

ARG ARM_GNU_TOOLCHAIN_VERSION=15.2.Rel1
ARG ARM_GNU_TOOLCHAIN_ARCHIVE=arm-gnu-toolchain-15.2.Rel1-x86_64-arm-none-eabi.tar.xz
ARG ARM_GNU_TOOLCHAIN_DIR=arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi
ARG ARM_GNU_TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu/${ARM_GNU_TOOLCHAIN_VERSION}/binrel/${ARM_GNU_TOOLCHAIN_ARCHIVE}
ARG PICO_SDK_VERSION=2.2.0

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    ca-certificates \
    cmake \
    curl \
    git \
    ninja-build \
    python3 \
    xz-utils && \
    rm -rf /var/lib/apt/lists/*

RUN mkdir -p /opt/toolchains /opt/pico-sdk && \
    curl -fsSL "${ARM_GNU_TOOLCHAIN_URL}" -o "/tmp/${ARM_GNU_TOOLCHAIN_ARCHIVE}" && \
    tar -xJf "/tmp/${ARM_GNU_TOOLCHAIN_ARCHIVE}" -C /opt/toolchains && \
    rm -f "/tmp/${ARM_GNU_TOOLCHAIN_ARCHIVE}" && \
    test -x "/opt/toolchains/${ARM_GNU_TOOLCHAIN_DIR}/bin/arm-none-eabi-gcc" && \
    git clone --branch "${PICO_SDK_VERSION}" --depth 1 https://github.com/raspberrypi/pico-sdk.git /opt/pico-sdk && \
    git -C /opt/pico-sdk submodule update --init --recursive

ENV ARM_GNU_TOOLCHAIN_VERSION=${ARM_GNU_TOOLCHAIN_VERSION}
ENV ARM_GNU_TOOLCHAIN_PATH=/opt/toolchains/${ARM_GNU_TOOLCHAIN_DIR}
ENV PICO_SDK_VERSION=${PICO_SDK_VERSION}
ENV PICO_SDK_PATH=/opt/pico-sdk
ENV PATH=${ARM_GNU_TOOLCHAIN_PATH}/bin:${PATH}

#include <sys/types.h>
#include <inttypes.h>
#include <string.h>

Expand Down
3 changes: 3 additions & 0 deletions src/cbortojson.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#include "cborinternal_p.h"
#include <memory.h>

// Include sys/types.h before inttypes.h to work around issue with
// certain versions of GCC and newlib which causes omission of PRIx64
#include <sys/types.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down