Skip to content

Warnings are errors#299

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:branch-21.10from
harrism:fix-raft-warnings-as-errors
Jul 28, 2021
Merged

Warnings are errors#299
rapids-bot[bot] merged 1 commit into
NVIDIA:branch-21.10from
harrism:fix-raft-warnings-as-errors

Conversation

@harrism

@harrism harrism commented Jul 27, 2021

Copy link
Copy Markdown
Contributor

This PR fixes current RAFT C++/CUDA compilation warnings and turns on -Wall to treat warnings as errors.

Fixes #225
Fixes #289

@harrism harrism requested review from a team as code owners July 27, 2021 05:54
@dantegd dantegd added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jul 27, 2021
@BradReesWork

Copy link
Copy Markdown
Contributor

I'm not a fan of relative paths (#include "../test_utils.h"), but PR looks good

@cjnolet cjnolet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@cjnolet

cjnolet commented Jul 28, 2021

Copy link
Copy Markdown
Contributor

@gpucibot merge

@rapids-bot rapids-bot Bot merged commit fc1e701 into NVIDIA:branch-21.10 Jul 28, 2021
@harrism

harrism commented Jul 28, 2021

Copy link
Copy Markdown
Contributor Author

I'm not a fan of relative paths (#include "../test_utils.h"), but PR looks good

Me neither, but I didn't change that, it was already there. If the build options don't include the base path to the header, and the header is not part of the library public interface, then relative paths are a necessity.

rapids-bot Bot pushed a commit that referenced this pull request Aug 4, 2021
Adds `-Werror=all-warnings` NVCC flag to ensure all CUDA device code warnings are treated as errors. Only enabled on CUDA 11.2+ because CUDA 11.0 has PTXAS warnings that go away in newer CUDA versions.

Missed this in #299.

Authors:
  - Mark Harris (https://github.com/harrism)

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #307
@harrism harrism mentioned this pull request Aug 5, 2021
rapids-bot Bot pushed a commit that referenced this pull request Aug 5, 2021
rapids-bot Bot pushed a commit to rapidsai/cuml that referenced this pull request Aug 10, 2021
Depends on NVIDIA/raft#299
Depends on NVIDIA/raft#311

Fixes #4086

This PR enables -Wall (warnings are errors) and fixes all current compiler warnings.

Compiler warnings should almost never be ignored. -Wall helps prevent hard-to-find bugs.

Tested with both Release and Debug builds since more warnings are typically reported in debug builds.

In any file I touched, I also cleaned up the includes so that they are grouped and sorted and ordered from "near" to "far" (relative to the file that is including).

Also cleaned up many instances of `size_t` --> `std::size_t`, however I will leave a global search and replace for a separate PR to make reviewing easier.

Authors:
  - Mark Harris (https://github.com/harrism)

Approvers:
  - Robert Maynard (https://github.com/robertmaynard)
  - William Hicks (https://github.com/wphicks)
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #4075
vimarsh6739 pushed a commit to vimarsh6739/cuml that referenced this pull request Oct 9, 2023
Depends on NVIDIA/raft#299
Depends on NVIDIA/raft#311

Fixes rapidsai#4086

This PR enables -Wall (warnings are errors) and fixes all current compiler warnings.

Compiler warnings should almost never be ignored. -Wall helps prevent hard-to-find bugs.

Tested with both Release and Debug builds since more warnings are typically reported in debug builds.

In any file I touched, I also cleaned up the includes so that they are grouped and sorted and ordered from "near" to "far" (relative to the file that is including).

Also cleaned up many instances of `size_t` --> `std::size_t`, however I will leave a global search and replace for a separate PR to make reviewing easier.

Authors:
  - Mark Harris (https://github.com/harrism)

Approvers:
  - Robert Maynard (https://github.com/robertmaynard)
  - William Hicks (https://github.com/wphicks)
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: rapidsai#4075
loulankxh pushed a commit to loulankxh/raft that referenced this pull request Oct 14, 2025
This PR fixes current RAFT C++/CUDA compilation warnings and turns on -Wall to treat warnings as errors.

Fixes NVIDIA#225
Fixes NVIDIA#289

Authors:
  - Mark Harris (https://github.com/harrism)

Approvers:
  - Brad Rees (https://github.com/BradReesWork)
  - Corey J. Nolet (https://github.com/cjnolet)

URL: NVIDIA#299
loulankxh pushed a commit to loulankxh/raft that referenced this pull request Oct 14, 2025
Adds `-Werror=all-warnings` NVCC flag to ensure all CUDA device code warnings are treated as errors. Only enabled on CUDA 11.2+ because CUDA 11.0 has PTXAS warnings that go away in newer CUDA versions.

Missed this in NVIDIA#299.

Authors:
  - Mark Harris (https://github.com/harrism)

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: NVIDIA#307
loulankxh pushed a commit to loulankxh/raft that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake cpp improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants