Name union to prevent compiler warning #7146

pull paveljanik wants to merge 1 commits into bitcoin:master from paveljanik:20151201_prevector_name_union changing 1 files +1 −1
  1. paveljanik commented at 2:22 PM on December 1, 2015: 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.
    
  2. sipa commented at 7:39 PM on December 1, 2015: member

    ACK

  3. sipa commented at 7:41 PM on December 1, 2015: member

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

  4. paveljanik commented at 7:46 PM on December 1, 2015: contributor

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

  5. jonasschnelli commented at 7:24 AM on December 2, 2015: contributor

    ACK once it uses a proper name.

  6. jonasschnelli added the label Refactoring on Dec 2, 2015
  7. paveljanik commented at 7:32 AM on December 2, 2015: contributor

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

  8. MarcoFalke commented at 7:35 AM on December 2, 2015: member

    direct_or_indirect

    Better than _somename

  9. Name union to prevent compiler warning 1812de9091
  10. paveljanik force-pushed on Dec 2, 2015
  11. jonasschnelli commented at 7:41 AM on December 2, 2015: contributor

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

  12. jonasschnelli commented at 7:41 AM on December 2, 2015: contributor

    ACK 1812de90915d002206148e7beae67d79d7a90e54

  13. paveljanik commented at 7:42 AM on December 2, 2015: contributor

    OK, thanks for your opinions. Name update.

  14. MarcoFalke commented at 7:44 AM on December 2, 2015: member

    utACK 1812de9 mod travis

  15. fanquake commented at 8:11 AM on December 2, 2015: member

    utACK Tested ACK

  16. laanwj merged this on Dec 2, 2015
  17. laanwj closed this on Dec 2, 2015

  18. laanwj referenced this in commit 0dd194c917 on Dec 2, 2015
  19. random-zebra referenced this in commit e0239f801d on May 22, 2020
  20. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 12:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me