diff --git a/Dockerfile b/Dockerfile index 4cc3622..0bd9059 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,6 @@ RUN apt-get update && apt-get install -y dirmngr RUN apt-get update && apt-get install --no-install-recommends -y \ ca-certificates \ clang \ - clang-format \ clang-tools \ cloc \ colordiff \ @@ -39,7 +38,9 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ xz-utils \ zbar-tools -RUN python3 -m pip install --break-system-packages cpp-coveralls +# clang-format is pinned so that CI and developer machines format identically; +# the Ubuntu package (v18) formats compound literals differently to v19+ +RUN python3 -m pip install --break-system-packages cpp-coveralls clang-format>=22.1 # Install Infer RUN mkdir -p /opt && curl -L https://github.com/facebook/infer/releases/download/v1.2.0/infer-linux-x86_64-v1.2.0.tar.xz | tar -C /opt -x -J diff --git a/pdfgen.c b/pdfgen.c index 1b20485..03c7ef6 100644 --- a/pdfgen.c +++ b/pdfgen.c @@ -719,10 +719,8 @@ static inline void *flexarray_get(const struct flexarray *flex, int index) */ #define INIT_DSTR \ - (struct dstr) \ - { \ - .static_data = {0}, .data = NULL, .alloc_len = 0, .used_len = 0 \ - } + (struct dstr){ \ + .static_data = {0}, .data = NULL, .alloc_len = 0, .used_len = 0} static char *dstr_data(struct dstr *str) {