Skip to content

Conversation

@js8544
Copy link
Collaborator

@js8544 js8544 commented Oct 24, 2023

Some compilers generate a maybe-uninitialized warning when compiling scalar_round.cc

/home/jinshang/arrow/cpp/src/arrow/util/logging.h: In function 'void arrow::compute::internal::RegisterScalarRoundArithmetic(arrow::compute::FunctionRegistry*)':
/home/jinshang/arrow/cpp/src/arrow/util/logging.h:59:34: warning: 'exec' may be used uninitialized [-Wmaybe-uninitialized]
   59 | #define ARROW_IGNORE_EXPR(expr) ((void)(expr))
      |                                  ^
/home/jinshang/arrow/cpp/src/arrow/compute/kernels/scalar_round.cc:1262:23: note: 'exec' was declared here
 1262 |       ArrayKernelExec exec;
      |                       ^~~~
/home/jinshang/arrow/cpp/src/arrow/util/logging.h:59:34: warning: 'exec' may be used uninitialized [-Wmaybe-uninitialized]
   59 | #define ARROW_IGNORE_EXPR(expr) ((void)(expr))
      |                                  ^
/home/jinshang/arrow/cpp/src/arrow/compute/kernels/scalar_round.cc:1283:23: note: 'exec' was declared here
 1283 |       ArrayKernelExec exec;
      |                       ^~~~

@vibhatha
Copy link
Collaborator

Looks okay to me.
cc @pitrou could you please take a look.

@kou kou changed the title MINOR: Fix a maybe-uninitialized warning MINOR: [C++] Fix a maybe-uninitialized warning Oct 25, 2023
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

@kou kou merged commit c655c33 into apache:main Oct 25, 2023
@kou kou removed the awaiting review Awaiting review label Oct 25, 2023
@github-actions github-actions bot added the awaiting merge Awaiting merge label Oct 25, 2023
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit c655c33.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.

loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
Some compilers generate a maybe-uninitialized warning when compiling scalar_round.cc
```
/home/jinshang/arrow/cpp/src/arrow/util/logging.h: In function 'void arrow::compute::internal::RegisterScalarRoundArithmetic(arrow::compute::FunctionRegistry*)':
/home/jinshang/arrow/cpp/src/arrow/util/logging.h:59:34: warning: 'exec' may be used uninitialized [-Wmaybe-uninitialized]
   59 | #define ARROW_IGNORE_EXPR(expr) ((void)(expr))
      |                                  ^
/home/jinshang/arrow/cpp/src/arrow/compute/kernels/scalar_round.cc:1262:23: note: 'exec' was declared here
 1262 |       ArrayKernelExec exec;
      |                       ^~~~
/home/jinshang/arrow/cpp/src/arrow/util/logging.h:59:34: warning: 'exec' may be used uninitialized [-Wmaybe-uninitialized]
   59 | #define ARROW_IGNORE_EXPR(expr) ((void)(expr))
      |                                  ^
/home/jinshang/arrow/cpp/src/arrow/compute/kernels/scalar_round.cc:1283:23: note: 'exec' was declared here
 1283 |       ArrayKernelExec exec;
      |                       ^~~~
```

Authored-by: Jin Shang <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
Some compilers generate a maybe-uninitialized warning when compiling scalar_round.cc
```
/home/jinshang/arrow/cpp/src/arrow/util/logging.h: In function 'void arrow::compute::internal::RegisterScalarRoundArithmetic(arrow::compute::FunctionRegistry*)':
/home/jinshang/arrow/cpp/src/arrow/util/logging.h:59:34: warning: 'exec' may be used uninitialized [-Wmaybe-uninitialized]
   59 | #define ARROW_IGNORE_EXPR(expr) ((void)(expr))
      |                                  ^
/home/jinshang/arrow/cpp/src/arrow/compute/kernels/scalar_round.cc:1262:23: note: 'exec' was declared here
 1262 |       ArrayKernelExec exec;
      |                       ^~~~
/home/jinshang/arrow/cpp/src/arrow/util/logging.h:59:34: warning: 'exec' may be used uninitialized [-Wmaybe-uninitialized]
   59 | #define ARROW_IGNORE_EXPR(expr) ((void)(expr))
      |                                  ^
/home/jinshang/arrow/cpp/src/arrow/compute/kernels/scalar_round.cc:1283:23: note: 'exec' was declared here
 1283 |       ArrayKernelExec exec;
      |                       ^~~~
```

Authored-by: Jin Shang <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants