Skip to content

Conversation

@sowelipililimute
Copy link

Copy link
Owner

@semlanik semlanik left a comment

Choose a reason for hiding this comment

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

@pontaoski, thank you for your commit! I left few suggestions, but the feature looks useful overall.

if(UNIX)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# using Clang
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wno-pessimizing-move -Wno-mismatched-tags -Wno-unused-private-field -Wno-self-assign-overloaded")
Copy link
Owner

Choose a reason for hiding this comment

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

Could you please move this fix to a separate patch set. I also suggest introducing something like 'QTPROTOBUF_DEVELOPER_BUILD' or 'QTPROTOBUF_WARNINGS_AS_ERROR' cache variable to opt-in this functionality.

Copy link
Author

Choose a reason for hiding this comment

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

oops, didn't mean to commit this. was a local workaround for the wall werror failing to build on my machine.

@sowelipililimute sowelipililimute force-pushed the work/janb/optiona branch 3 times, most recently from 061523d to 1c7a062 Compare September 26, 2021 00:44
@sowelipililimute
Copy link
Author

something i'm not too sure on is how to go about making it so that the constructors only default to true if the value is initialised in said constructors. currently all has_ values default to true even if the constructor doesn't initialise them.

@semlanik
Copy link
Owner

something i'm not too sure on is how to go about making it so that the constructors only default to true if the value is initialised in said constructors. currently all has_ values default to true even if the constructor doesn't initialise them.

Sorry for the dreadful delay in response, but I'm not sure what has_ values you are talking about.

@sowelipililimute
Copy link
Author

something i'm not too sure on is how to go about making it so that the constructors only default to true if the value is initialised in said constructors. currently all has_ values default to true even if the constructor doesn't initialise them.

Sorry for the dreadful delay in response, but I'm not sure what has_ values you are talking about.

this MR adds has_foo values for optional t foo = 1 fields in a protobuf, corresponding to whether or not that field has been initialised with a value. my question mostly involves about how to handle this with protobuf construction.

currently, the has_x fields default to true, even if they don't contain a value. https://github.com/semlanik/qtprotobuf/pull/246/files#diff-d9dc8230aa3e8c9ba4ad3e3c9b5c70c062a83452a6c0a631fbe4d49d150fe674R358

my problem is "how do i make the has_x fields only get set to true during construction if the corresponding argument for x in the constructor is set"

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.

2 participants