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 nullable string example failure on gcc7 #2266

Merged
merged 6 commits into from
May 18, 2021

Conversation

bdeng-xt
Copy link
Contributor

@bdeng-xt bdeng-xt commented May 14, 2021

The nullable string array example(nullable_attribute.cc) fails on CentOS7/gcc7.3 with an incomplete query. Finally I found that it is not a bug from gcc7. The bug for calculating max_size_validity caused that problem. When we add three attributes a1,a2,a3, the unordered_map buffer still keep in that order gcc4.8, clang, and vc2015. But in gcc 7, a2 becomes the first when we try to iterate. The incomplete query is not found when we use gcc4.8, clang or vc2015, since a1 is a fixed size attribute and a1 still shows to be the first in gcc4.8 and other compilers. If our example use more attributes, the incomplete query could also happen for gcc4.8, clang and vc2015. This incomplete query can also happen for other kinds of variable size attributes(such as vector). In this branch, I also fixed some warnings from gcc compiler when we provided unused parameters for default constructors and assign operators.


TYPE: BUG
DESC: The bug for calculating max_size_validity for var_size attribute caused incomplete query

Copy link
Contributor

@joe-maley joe-maley left a comment

Choose a reason for hiding this comment

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

Great fix!

FYI, Windows CI is failing on:

D:\a\1\s\examples\cpp_api\nullable_attribute.cc(185): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data 

examples/cpp_api/nullable_attribute.cc Outdated Show resolved Hide resolved
@joe-maley joe-maley merged commit 70ddc9a into dev May 18, 2021
@Shelnutt2 Shelnutt2 deleted the bd/fix-gcc7-nullable-attribute-failure branch June 8, 2021 10:53
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.

None yet

3 participants