Skip to content

Conversation

@paveljanik
Copy link
Contributor

After merging #6914, a lot of compiler warnings are emitted by clang:

  CXX      test/test_test_bitcoin-main_tests.o
In file included from test/main_tests.cpp:5:
In file included from ./chainparams.h:11:
In file included from ./primitives/block.h:9:
In file included from ./primitives/transaction.h:9:
In file included from ./amount.h:9:
In file included from ./serialize.h:23:
./prevector.h:419:13: warning: template argument uses unnamed type [-Wunnamed-type-template-args]
            std::swap(_union, other._union);
            ^~~
./script/script.h:618:23: note: in instantiation of member function 'prevector<28, unsigned char, unsigned int, int>::swap' requested here
        CScriptBase().swap(*this);
                      ^
./prevector.h:143:5: note: unnamed type used in template argument was declared here
    union {
    ^
1 warning generated.

@sipa
Copy link
Member

sipa commented Dec 1, 2015

ACK

@sipa
Copy link
Member

sipa commented Dec 1, 2015

But if you're going to give it a name anyway, better make it a descriptive one, like "direct_or_indirect"?

@paveljanik
Copy link
Contributor Author

I was about to use foo 8) I'll wait for other ideas (but your name is OK for me).

@jonasschnelli
Copy link
Contributor

ACK once it uses a proper name.

@paveljanik
Copy link
Contributor Author

@jonasschnelli And do you have an opinion the correct name? Do you agree with direct_or_indirect as @sipa offered?

@maflcko
Copy link
Member

maflcko commented Dec 2, 2015

direct_or_indirect

Better than _somename

@paveljanik paveljanik force-pushed the 20151201_prevector_name_union branch from f05f2d0 to 1812de9 Compare December 2, 2015 07:41
@jonasschnelli
Copy link
Contributor

direct_or_indirect sounds after the purpose of the union, so yes, would be better then _somename.

@jonasschnelli
Copy link
Contributor

ACK 1812de9

@paveljanik
Copy link
Contributor Author

OK, thanks for your opinions. Name update.

@maflcko
Copy link
Member

maflcko commented Dec 2, 2015

utACK 1812de9 mod travis

@fanquake
Copy link
Member

fanquake commented Dec 2, 2015

utACK Tested ACK

@laanwj laanwj merged commit 1812de9 into bitcoin:master Dec 2, 2015
laanwj added a commit that referenced this pull request Dec 2, 2015
1812de9 Name union to prevent compiler warning (Pavel Janík)
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request May 22, 2020
…zation

30e975e Lift prevector default vals to the member declaration (random-zebra)
3217b2b Name union to prevent compiler warning (random-zebra)

Pull request description:

  Two simple additions to `prevector` class:
  - name the union, to prevent compiler warnings emitted by clang (from bitcoin#7146)
  - use non-static data member initializers for `_size` and `_union` (from bitcoin#14266)

ACKs for top commit:
  furszy:
    utACK 30e975e
  Fuzzbawls:
    utACK 30e975e

Tree-SHA512: f7a0dd55bbf2df0b9d0d72967ac00c476aebde936499cd3d1b5a7552aded6b7022c5a23c859eaa3599875f2c2c7bd737afdda3cd31db9d7e2c5dfdca7f0c9809
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants