# Fix protobuf compiler warning with clang

XMLWordPrintable

## Details

• Type: Improvement
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Story Points:
1
• Sprint:
DB_W16_09
• Team:
Data Access and Database

## Activity

Hide
Tim Jenness added a comment -

I don't know enough C++ to comment usefully on this fix. It seems like clang knows what is happening but is also indicating that it's not part of the C++11 standard so warns because of the compiler flags.

Show
Tim Jenness added a comment - I don't know enough C++ to comment usefully on this fix. It seems like clang knows what is happening but is also indicating that it's not part of the C++11 standard so warns because of the compiler flags.
Hide
Kian-Tat Lim added a comment -

Is it simpler to just name the internal union without yanking it outside? I think that would also eliminate the possibility of the internal union's name colliding with anything else.

Show
Kian-Tat Lim added a comment - Is it simpler to just name the internal union without yanking it outside? I think that would also eliminate the possibility of the internal union's name colliding with anything else.
Hide
Fritz Mueller added a comment -

I don't think that's allowed – I'll give it a try and see and if so I'll do that.

Show
Fritz Mueller added a comment - I don't think that's allowed – I'll give it a try and see and if so I'll do that.
Hide
Fritz Mueller added a comment -

Ya, nope:

 ./google/protobuf/unknown_field_set.h:214:11: error: types cannot be declared in an anonymous union  union length_delimited { 

Even in the yanked out version, it's still private, so it shouldn't cause any conflicts.

Show
Fritz Mueller added a comment - Ya, nope: ./google/protobuf/unknown_field_set.h:214:11: error: types cannot be declared in an anonymous union union length_delimited { Even in the yanked out version, it's still private, so it shouldn't cause any conflicts.
Hide
Kian-Tat Lim added a comment -

OK, g++ didn't complain . I'm fine with what you have.

Show
Kian-Tat Lim added a comment - OK, g++ didn't complain . I'm fine with what you have.
Hide
Fritz Mueller added a comment -

Tagged and bagged as protobuf-2.6.1.lsst2

Show
Fritz Mueller added a comment - Tagged and bagged as protobuf-2.6.1.lsst2

## People

• Assignee:
Fritz Mueller
Reporter:
Fritz Mueller
Reviewers:
Kian-Tat Lim, Tim Jenness
Watchers:
Fritz Mueller, Kian-Tat Lim, Tim Jenness