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

Fix compiler warnings. #9055

Merged
merged 1 commit into from
Apr 20, 2023
Merged

Fix compiler warnings. #9055

merged 1 commit into from
Apr 20, 2023

Conversation

trivialfis
Copy link
Member

  • Broadcast string directly.
  • Avoid type-erased pointer.
/src/metric/../collective/aggregator.h:46:16:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:34: warning: ‘char* __builtin_strncpy(char*, const char*, long 
unsigned int)’ specified bound 1024 equals destination size [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));

@trivialfis
Copy link
Member Author

trivialfis commented Apr 20, 2023

cc @rongou .

There's an option in xgboost CMake: ENABLE_ALL_WARNINGS, which can be useful from time to time.

@trivialfis trivialfis merged commit a7b3dd3 into dmlc:master Apr 20, 2023
@trivialfis trivialfis deleted the fix-warnings branch April 20, 2023 18:26
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.

2 participants