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

[C++] Suppress -Wmissing-field-initializers in DayMilliseconds arrow/type.h #29132

Closed
asfimport opened this issue Jul 27, 2021 · 3 comments
Closed

Comments

@asfimport
Copy link

The absence of default values for days and milliseconds triggers a compiler warning in some compilers. This could be resolved by setting the struct member default values to 0

see mailing list thread https://lists.apache.org/thread.html/r8b7dfdb456538dab57c533376cf1e9538cdbc84213e24f35cc5aaca3%40%3Cdev.arrow.apache.org%3E

Reporter: Wes McKinney / @wesm
Assignee: Fernando Rodriguez / @diegodfrf

PRs and other links:

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

@asfimport
Copy link
Author

Fernando Rodriguez / @diegodfrf:
Can you provide us with a snippet to reproduce the warning? It was not possible to reproduce.

@asfimport
Copy link
Author

Rares Vernica / @rvernica:
This is one of the files where I get the warning https://github.com/Paradigm4/bridge/blob/11cc69f421bc88b8e183d55b1f906620a542e6a3/src/XIndex.cpp

 


"/opt/rh/devtoolset-3/root/usr/bin/g++" -DARROW_NO_DEPRECATED_API -DNDEBUG -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -Wall -Wextra -Wno-long-long -Wno-strict-aliasing -Wno-system-headers -Wno-unused -Wno-unused-parameter -Wno-variadic-macros -fPIC -fno-omit-frame-pointer -g -std=c++14 -DAWS_COMMON_USE_IMPORT_EXPORT -DAWS_EVENT_STREAM_USE_IMPORT_EXPORT -DAWS_SDK_VERSION_MAJOR=1 -DAWS_SDK_VERSION_MINOR=8 -DAWS_SDK_VERSION_PATCH=3 -DPROJECT_ROOT="\"/opt/scidb/19.11\"" -I. -I"/opt/scidb/19.11/include" -I"/opt/scidb/19.11/3rdparty/boost/include" -I/opt/aws-sdk-cpp/include -I/opt/apache-arrow/include -c -o XIndex.o XIndex.cpp

In file included from /opt/apache-arrow/include/arrow/array/builder_dict.h:29:0,
 from /opt/apache-arrow/include/arrow/builder.h:26,
 from XIndex.cpp:38:
/opt/apache-arrow/include/arrow/array/builder_primitive.h: In instantiation of 'arrow::Status arrow::NumericBuilder<TypeClass>::AppendNull() [with T = arrow::DayTimeIntervalType]':
XIndex.cpp:430:1: required from here
/opt/apache-arrow/include/arrow/array/builder_primitive.h:102:5: warning: missing initializer for member 'arrow::DayTimeIntervalType::DayMilliseconds::days' [-Wmissing-field-initializers]
 data_builder_.UnsafeAppend(value_type{}); // zero
 ^
/opt/apache-arrow/include/arrow/array/builder_primitive.h:102:5: warning: missing initializer for member 'arrow::DayTimeIntervalType::DayMilliseconds::milliseconds' [-Wmissing-field-initializers]
/opt/apache-arrow/include/arrow/array/builder_primitive.h: In instantiation of 'arrow::Status arrow::NumericBuilder<TypeClass>::AppendNulls(int64_t) [with T = arrow::DayTimeIntervalType; int64_t = long int]':
XIndex.cpp:430:1: required from here
/opt/apache-arrow/include/arrow/array/builder_primitive.h:94:5: warning: missing initializer for member 'arrow::DayTimeIntervalType::DayMilliseconds::days' [-Wmissing-field-initializers]
 data_builder_.UnsafeAppend(length, value_type{}); // zero
 ^
/opt/apache-arrow/include/arrow/array/builder_primitive.h:94:5: warning: missing initializer for member 'arrow::DayTimeIntervalType::DayMilliseconds::milliseconds' [-Wmissing-field-initializers]
/opt/apache-arrow/include/arrow/array/builder_primitive.h: In instantiation of 'arrow::Status arrow::NumericBuilder<TypeClass>::AppendEmptyValue() [with T = arrow::DayTimeIntervalType]':
XIndex.cpp:430:1: required from here
/opt/apache-arrow/include/arrow/array/builder_primitive.h:110:5: warning: missing initializer for member 'arrow::DayTimeIntervalType::DayMilliseconds::days' [-Wmissing-field-initializers]
 data_builder_.UnsafeAppend(value_type{}); // zero
 ^
/opt/apache-arrow/include/arrow/array/builder_primitive.h:110:5: warning: missing initializer for member 'arrow::DayTimeIntervalType::DayMilliseconds::milliseconds' [-Wmissing-field-initializers]
/opt/apache-arrow/include/arrow/array/builder_primitive.h: In instantiation of 'arrow::Status arrow::NumericBuilder<TypeClass>::AppendEmptyValues(int64_t) [with T = arrow::DayTimeIntervalType; int64_t = long int]':
XIndex.cpp:430:1: required from here
/opt/apache-arrow/include/arrow/array/builder_primitive.h:118:5: warning: missing initializer for member 'arrow::DayTimeIntervalType::DayMilliseconds::days' [-Wmissing-field-initializers]
 data_builder_.UnsafeAppend(length, value_type{}); // zero
 ^
/opt/apache-arrow/include/arrow/array/builder_primitive.h:118:5: warning: missing initializer for member 'arrow::DayTimeIntervalType::DayMilliseconds::milliseconds' [-Wmissing-field-initializers] 

 

@asfimport
Copy link
Author

David Li / @lidavidm:
Issue resolved by pull request 10842
#10842

@asfimport asfimport added this to the 6.0.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant