Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues/0146 strict aliasing violations #147

Merged
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
12 changes: 12 additions & 0 deletions .github/workflows/docker_linuxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ jobs:
- name: Run ctlrender within the Docker image
run: docker run ctl:latest sh -c "ctlrender -ctl /usr/src/aces-dev/transforms/ctl/utilities/ACESutil.Unity.ctl /usr/src/aces-dev/images/ACES/SonyF35.StillLife.exr /tmp/testout.exr"

ubuntu-22-04-LTO:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build --no-cache --rm -f ./docker/Dockerfile_ubuntu_22.04_LTO -t ctl:latest .

- name: Run unit tests (ctest) within the Docker image
run: docker run ctl:latest sh -c "cd ./build && ctest"

ubuntu-23-10:

runs-on: ubuntu-latest
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/windows_vcpkg_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ jobs:
- name: install dependencies - openexr
run: vcpkg install openexr

- name: install dependencies - tiff
run: vcpkg install tiff
# disabling tiff due to security issue
# https://github.com/microsoft/vcpkg/issues/37871
# https://github.com/microsoft/vcpkg/issues/37839
# - name: install dependencies - tiff
# run: vcpkg install tiff

- name: check vcpkg install status
run: vcpkg list
Expand Down Expand Up @@ -66,8 +69,11 @@ jobs:
- name: install dependencies - openexr
run: vcpkg install openexr

- name: install dependencies - tiff
run: vcpkg install tiff
# disabling tiff due to security issue
# https://github.com/microsoft/vcpkg/issues/37871
# https://github.com/microsoft/vcpkg/issues/37839
# - name: install dependencies - tiff
# run: vcpkg install tiff

- name: check vcpkg install status
run: vcpkg list
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/windows_vcpkg_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ jobs:
- name: install dependencies - openexr
run: vcpkg install openexr:x64-windows

- name: install dependencies - tiff
run: vcpkg install tiff:x64-windows
# disabling tiff due to security issue
# https://github.com/microsoft/vcpkg/issues/37871
# https://github.com/microsoft/vcpkg/issues/37839
#- name: install dependencies - tiff
# run: vcpkg install tiff:x64-windows

- name: check vcpkg install status
run: vcpkg list
Expand Down Expand Up @@ -66,8 +69,11 @@ jobs:
- name: install dependencies - openexr
run: vcpkg install openexr:x64-windows

- name: install dependencies - tiff
run: vcpkg install tiff:x64-windows
# disabling tiff due to security issue
# https://github.com/microsoft/vcpkg/issues/37871
# https://github.com/microsoft/vcpkg/issues/37839
#- name: install dependencies - tiff
# run: vcpkg install tiff:x64-windows

- name: check vcpkg install status
run: vcpkg list
Expand Down
27 changes: 27 additions & 0 deletions docker/Dockerfile_ubuntu_22.04_LTO
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:22.04

RUN apt-get update

# disable interactive install
ENV DEBIAN_FRONTEND noninteractive

# install developement tools
RUN apt-get -y install cmake
RUN apt-get -y install g++

# install CTL dependencies
RUN apt-get -y install libopenexr-dev
RUN apt-get -y install libtiff-dev

# build CTL
WORKDIR /usr/src/CTL
COPY . .
WORKDIR /usr/src/CTL/build
RUN rm -R * || true
RUN cmake .. -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE -DCMAKE_VERBOSE_MAKEFILE=on -DCMAKE_CXX_FLAGS="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
RUN make
RUN make install

# finalize docker environment
WORKDIR /usr/src/CTL

13 changes: 11 additions & 2 deletions lib/IlmCtlSimd/halfExpLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Do not edit.
//

#include <string.h>

extern const unsigned int log10Table[];
extern const unsigned int logTable[];
Expand All @@ -12,14 +13,22 @@ extern const unsigned short expTable[];
inline float
log10_h (half x)
{
return *(float *)(&log10Table[x.bits()]);
int i = log10Table[x.bits()];
float f;
memcpy(&f, &i, sizeof(i));
return f;
//return *(float *)(&log10Table[x.bits()]);
}


inline float
log_h (half x)
{
return *(float *)(&logTable[x.bits()]);
int i = logTable[x.bits()];
float f;
memcpy(&f, &i, sizeof(i));
return f;
//return *(float *)(&logTable[x.bits()]);
}


Expand Down
5 changes: 4 additions & 1 deletion lib/dpx/dpx_raw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ bool dpx::isnull(uint8_t v) {
}

bool dpx::isnull(float32_t v) {
return *((uint32_t *)&v)==(uint32_t)-1;
uint32_t u;
memcpy(&u, &v, sizeof(v));
return (u == (uint32_t)-1) ? true : false;
//return *((uint32_t *)&v)==(uint32_t)-1;
}

}
3 changes: 1 addition & 2 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "1.5.3",
"dependencies": [
"imath",
"openexr",
"tiff"
"openexr"
]
}
Loading