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

ICU-22767 Fix GCC warning and turn warning to errors #3129

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

FrankYFTang
Copy link
Contributor

@FrankYFTang FrankYFTang commented Sep 5, 2024

-Wdangling-pointer can first found in 12.4

Warning Options (Using the GNU Compiler Collection (GCC))

but not in 11.5

-Wstringop-overflow can first found in 11.5

Warning Options (Using the GNU Compiler Collection (GCC))

but not in 10.5

-Wreturn-local-addr first found in 4.8.5

Warning Options - Using the GNU Compiler Collection (GCC)

but not in 4.7.4

-Warray-bounds first found in 4.3.6

Warning Options - Using the GNU Compiler Collection (GCC)

but not in 4.2.4

Checklist
  • Required: Issue filed: https://unicode-org.atlassian.net/browse/ICU-22767
  • Required: The PR title must be prefixed with a JIRA Issue number.
  • Required: The PR description must include the link to the Jira Issue, for example by completing the URL in the first checklist item
  • Required: Each commit message must be prefixed with a JIRA Issue number.
  • Issue accepted (done by Technical Committee after discussion)
  • Tests included, if applicable
  • API docs and/or User Guide docs changed or added, if applicable

@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from 188b66d to 552abea Compare September 5, 2024 04:31
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/common/ucurr.cpp is different
  • icu4c/source/i18n/decNumber.cpp is different
  • icu4c/source/i18n/formattedvalue.cpp is different
  • icu4c/source/i18n/number_skeletons.cpp is different
  • icu4c/source/test/cintltst/utf16tst.c is now changed in the branch
  • icu4c/source/test/cintltst/utf8tst.c is now changed in the branch

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@FrankYFTang FrankYFTang requested review from roubert and sffc September 5, 2024 04:34
@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from b8b4ba9 to 137c405 Compare September 5, 2024 04:47
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/i18n/formattedvalue.cpp is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from 137c405 to d07b151 Compare September 5, 2024 06:26
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/i18n/decNumber.cpp is different
  • icu4c/source/i18n/formattedvalue.cpp is different
  • icu4c/source/i18n/number_skeletons.cpp is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@roubert
Copy link
Member

roubert commented Sep 5, 2024

The gcc-10-stdlib17 tests still fail with -Werror=return-local-addr.

@markusicu markusicu requested a review from eggrobin September 5, 2024 16:56
@FrankYFTang FrankYFTang changed the title ICU-22716 Fix GCC warning and turn warning to errors ICU-22767 Fix GCC warning and turn warning to errors Sep 5, 2024
@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from 3521f13 to aacfcf7 Compare September 5, 2024 17:40
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

icu4c/source/common/ucnvmbcs.cpp Outdated Show resolved Hide resolved
icu4c/source/common/ucnvmbcs.cpp Outdated Show resolved Hide resolved
icu4c/source/common/ushape.cpp Outdated Show resolved Hide resolved
icu4c/source/test/cintltst/custrtrn.c Show resolved Hide resolved
@FrankYFTang
Copy link
Contributor Author

@markusicu
I have trouble to reproduce the following in my local machine and understand these messages. Do you have any clue how to fix it?

In file included from ../../../icu4c/source/tools/toolutil/ppucd.cpp:21:
In member function ‘icu_76::UniProps& icu_76::UniProps::operator=(const icu_76::UniProps&)’,
    inlined from ‘const icu_76::UniProps* icu_76::PreparsedUCD::getProps(icu_76::UnicodeSet&, UErrorCode&)’ at ../../../icu4c/source/tools/toolutil/ppucd.cpp:239:25:
../../../icu4c/source/tools/toolutil/ppucd.h:43:23: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=]
   43 | struct U_TOOLUTIL_API UniProps {
      |                       ^~~~~~~~
../../../icu4c/source/tools/toolutil/ppucd.h: In member function ‘const icu_76::UniProps* icu_76::PreparsedUCD::getProps(icu_76::UnicodeSet&, UErrorCode&)’:
../../../icu4c/source/tools/toolutil/ppucd.h:49:13: note: at offset 0 to object ‘icu_76::UniProps::start’ with size 4 declared here
   49 |     UChar32 start, end;
      |             ^~~~~
In member function ‘icu_76::UniProps& icu_76::UniProps::operator=(const icu_76::UniProps&)’,
    inlined from ‘const icu_76::UniProps* icu_76::PreparsedUCD::getProps(icu_76::UnicodeSet&, UErrorCode&)’ at ../../../icu4c/source/tools/toolutil/ppucd.cpp:235:25:
../../../icu4c/source/tools/toolutil/ppucd.h:43:23: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=]
   43 | struct U_TOOLUTIL_API UniProps {
      |                       ^~~~~~~~
../../../icu4c/source/tools/toolutil/ppucd.h: In member function ‘const icu_76::UniProps* icu_76::PreparsedUCD::getProps(icu_76::UnicodeSet&, UErrorCode&)’:
../../../icu4c/source/tools/toolutil/ppucd.h:49:13: note: at offset 0 to object ‘icu_76::UniProps::start’ with size 4 declared here
   49 |     UChar32 start, end;
      |             ^~~~~
In member function ‘icu_76::UniProps& icu_76::UniProps::operator=(const icu_76::UniProps&)’,
    inlined from ‘const icu_76::UniProps* icu_76::PreparsedUCD::getProps(icu_76::UnicodeSet&, UErrorCode&)’ at ../../../icu4c/source/tools/toolutil/ppucd.cpp:248:21:
../../../icu4c/source/tools/toolutil/ppucd.h:43:23: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=]
   43 | struct U_TOOLUTIL_API UniProps {
      |                       ^~~~~~~~
../../../icu4c/source/tools/toolutil/ppucd.h: In member function ‘const icu_76::UniProps* icu_76::PreparsedUCD::getProps(icu_76::UnicodeSet&, UErrorCode&)’:
../../../icu4c/source/tools/toolutil/ppucd.h:49:13: note: at offset 0 to object ‘icu_76::UniProps::start’ with size 4 declared here
   49 |     UChar32 start, end;
      |             ^~~~~
cc1plus: all warnings being treated as errors
*** Failed compilation command follows: ----------------------------------------------------------

@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from a4e208f to 77d4d85 Compare September 6, 2024 19:27
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • .github/workflows/icu4c.yml is different
  • icu4c/source/common/ucnvmbcs.cpp is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

FrankYFTang added a commit to FrankYFTang/icu that referenced this pull request Sep 9, 2024
@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from 8e666e5 to d5d0784 Compare September 9, 2024 22:01
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from d5d0784 to 99d9fb0 Compare September 9, 2024 22:23
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/common/ucnvmbcs.cpp is different
  • icu4c/source/i18n/decNumber.cpp is different
  • icu4c/source/i18n/number_rounding.cpp is different
  • icu4c/source/i18n/number_skeletons.cpp is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from 99d9fb0 to 7d28d61 Compare September 10, 2024 21:27
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/common/ucnvmbcs.cpp is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@FrankYFTang
Copy link
Contributor Author

PTAL

.github/workflows/icu4c.yml Outdated Show resolved Hide resolved
.github/workflows/icu4c.yml Outdated Show resolved Hide resolved
Copy link
Member

@roubert roubert left a comment

Choose a reason for hiding this comment

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

With the warnings added to the gcc-debug-build-and-test job, you got yet one more maybe-uninitialized that'll need to be addressed.

icu4c/source/test/cintltst/uformattedvaluetst.c Outdated Show resolved Hide resolved
FrankYFTang added a commit to FrankYFTang/icu that referenced this pull request Sep 25, 2024
@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from 7ce8d20 to 1647bd2 Compare September 25, 2024 04:36
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

FrankYFTang added a commit to FrankYFTang/icu that referenced this pull request Sep 25, 2024
ICU-22716 use pre-existing task

ICU-22716 Fix

ICU-22716 Fix unitialization

Update icu4c/source/common/ushape.cpp

Co-authored-by: Fredrik Roubert <[email protected]>

ICU-22716 change macro

ICU-22716 Add document about the macro

ICU-22716 Addres review feedback

ICU-22767 Fix GCC warning and turn warning to errors

ICU-22716 use pre-existing task

ICU-22716 Fix

ICU-22716 Fix unitialization

Update icu4c/source/common/ushape.cpp

Co-authored-by: Fredrik Roubert <[email protected]>

ICU-22716 change macro

ICU-22716 Add document about the macro

ICU-22716 Addres review feedback

ICU-22767 Fix GCC warning and turn warning to errors

ICU-22716 use pre-existing task

ICU-22716 Fix

ICU-22716 Fix unitialization

Update icu4c/source/common/ushape.cpp

Co-authored-by: Fredrik Roubert <[email protected]>

ICU-22767 Fix GCC warning and turn warning to errors

ICU-22716 use pre-existing task

ICU-22716 Fix

ICU-22716 Fix unitialization

Update icu4c/source/common/ushape.cpp

Co-authored-by: Fredrik Roubert <[email protected]>

ICU-22716 change macro

ICU-22716 Add document about the macro

ICU-22716 Addres review feedback

ICU-22767 Fix GCC warning and turn warning to errors

ICU-22716 use pre-existing task

ICU-22716 Fix

ICU-22716 Fix unitialization

Update icu4c/source/common/ushape.cpp

Co-authored-by: Fredrik Roubert <[email protected]>

ICU-22716 change macro

ICU-22716 Add document about the macro

ICU-22716 Address feedback

ICU-22767 Fix GCC warning and turn warning to errors

See unicode-org#3129
@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from 4f62a55 to 9e89648 Compare September 25, 2024 18:22
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

FrankYFTang added a commit to FrankYFTang/icu that referenced this pull request Sep 25, 2024
@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from e6b0be8 to 01c3b54 Compare September 25, 2024 22:10
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

FrankYFTang added a commit to FrankYFTang/icu that referenced this pull request Sep 25, 2024
@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from 01c3b54 to 1627204 Compare September 25, 2024 22:10
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@FrankYFTang
Copy link
Contributor Author

PTAL I removed unncessary changes

.github/workflows/icu4c.yml Outdated Show resolved Hide resolved
@FrankYFTang
Copy link
Contributor Author

During the ICUTC this morning. I agree to Markus we should hold this till 77.1

FrankYFTang added a commit to FrankYFTang/icu that referenced this pull request Oct 1, 2024
@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from dbfc1b6 to 360dbf5 Compare October 1, 2024 21:25
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@FrankYFTang FrankYFTang force-pushed the ICU-22716-fixGCCWarning branch from 360dbf5 to c8988fa Compare October 1, 2024 21:25
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@FrankYFTang FrankYFTang requested a review from roubert October 1, 2024 21:26
@FrankYFTang
Copy link
Contributor Author

PTAL

@FrankYFTang
Copy link
Contributor Author

@roubert PTAL

@FrankYFTang FrankYFTang dismissed roubert’s stale review October 2, 2024 20:34

already merged the suggested change

@FrankYFTang FrankYFTang merged commit 8437d1d into unicode-org:main Oct 2, 2024
102 checks passed
@FrankYFTang FrankYFTang deleted the ICU-22716-fixGCCWarning branch October 2, 2024 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants