Skip to content

[C++] Compiler warnings on mingw-w64 #22268

@asfimport

Description

@asfimport

In mingw64 we see the following warnings:

[ 54%] Building CXX object src/arrow/CMakeFiles/arrow_static.dir/util/io-util.cc.obj
C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/util/decimal.cc: In static member function 'static arrow::Status arrow::Decimal128::FromString(const string_view&, arrow::Decimal128*, int32_t*, int32_t*)':
C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/util/decimal.cc:313:35: warning: 'dec.arrow::{anonymous}::DecimalComponents::exponent' may be used uninitialized in this function [-Wmaybe-uninitialized]
       *scale = -adjusted_exponent + len - 1;
                ~~~~~~~~~~~~~~~~~~~^~~~
[ 56%] Building CXX object src/arrow/CMakeFiles/arrow_static.dir/util/string_builder.cc.obj
C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/util/io-util.cc: In static member function 'static arrow::Status arrow::internal::TemporaryDir::Make(const string&, std::unique_ptr<arrow::internal::TemporaryDir>*)':
C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/util/io-util.cc:897:3: warning: 'created' may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (!created) {
   ^~

And on mingw32 we also see these:

In file included from C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/io/file.cc:25:
C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/io/mman.h: In function 'void* mmap(void*, size_t, int, int, int, off_t)':
C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/io/mman.h:94:62: warning: right shift count >= width of type [-Wshift-count-overflow]
   const DWORD dwMaxSizeHigh = static_cast<DWORD>((maxSize >> 32) & 0xFFFFFFFFL);
                                                              ^~
 54%] Building CXX object src/arrow/CMakeFiles/arrow_static.dir/util/logging.cc.obj
In file included from C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/util/io-util.cc:63:
C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/io/mman.h: In function 'void* mmap(void*, size_t, int, int, int, off_t)':
C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/io/mman.h:94:62: warning: right shift count >= width of type [-Wshift-count-overflow]
   const DWORD dwMaxSizeHigh = static_cast<DWORD>((maxSize >> 32) & 0xFFFFFFFFL);
                                                              ^~
C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/util/io-util.cc: In function 'arrow::Status arrow::internal::MemoryMapRemap(void*, size_t, size_t, int, void**)':
C:/msys64/home/mingw-packages/mingw-w64-arrow/src/arrow/cpp/src/arrow/util/io-util.cc:568:55: warning: right shift count >= width of type [-Wshift-count-overflow]
   LONG new_size_high = static_cast<LONG>((new_size >> 32) & 0xFFFFFFFFL);
                                 

Reporter: Jeroen / @jeroen
Assignee: Antoine Pitrou / @pitrou

PRs and other links:

Note: This issue was originally created as ARROW-5849. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions