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

Suppress -Wformat-truncation for older GCC #101557

Merged
merged 2 commits into from
May 9, 2024

Conversation

am11
Copy link
Member

@am11 am11 commented Apr 25, 2024

Build was hitting an error since #92674:

$. docker run --rm -v$(pwd)/runtime:/runtime -e ROOTFS_DIR=/crossrootfs/x64 \
      mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-illumos-20220531132048-f13d79e \
      /runtime/build.sh -c Release -os illumos -cross -gcc
...
   -- The C compiler identification is GNU 8.4.0
...
  [ 33%] Building C object System.Native/CMakeFiles/System.Native-Static.dir/pal_signal.c.o
  /runtime/src/native/libs/System.Globalization.Native/pal_icushim.c: In function 'OpenICULibraries.constprop':
/runtime/src/native/libs/System.Globalization.Native/pal_icushim.c(66,57): error G01DC61E5: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=] [/runtime/src/native/libs/build-native.proj]
           snprintf(symbolVersion, symbolVersionLen, "_%d%s", majorVer, suffix);
                                                           ^
  /runtime/src/native/libs/System.Globalization.Native/pal_icushim.c:66:9: note: 'snprintf' output between 3 and 49 bytes into a destination of size 38
           snprintf(symbolVersion, symbolVersionLen, "_%d%s", majorVer, suffix);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This warning was introduced in gcc v7 and had bugs until v9.

@am11 am11 requested a review from jkoritzinsky April 25, 2024 17:08
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Apr 25, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

@tarekgh
Copy link
Member

tarekgh commented May 9, 2024

@am11 could you please merge the latest changes from main into your PR? Thanks!

@am11
Copy link
Member Author

am11 commented May 9, 2024

@tarekgh, done. Branch is up-to-date (modulo the merges made to the main branch in past two hours 😄).

@tarekgh tarekgh merged commit 315c4c4 into dotnet:main May 9, 2024
159 checks passed
@am11 am11 deleted the feature/build/illumos-fixes branch May 9, 2024 21:13
Ruihan-Yin pushed a commit to Ruihan-Yin/runtime that referenced this pull request May 30, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Globalization community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants