Cleans up a bunch of: warning: missing braces around initializer for ‘const<anonymous struct>’
bitcoin-tx: fix compile warnings #4696
pull theuni wants to merge 1 commits into bitcoin:master from theuni:tx-fix-warnings changing 1 files +6 −6-
theuni commented at 3:58 PM on August 13, 2014: member
-
616c24307f
bitcoin-tx: fix build warnings
Cleans up a bunch of: warning: missing braces around initializer for ‘const<anonymous struct>’
-
jgarzik commented at 7:33 PM on August 13, 2014: contributor
Perhaps better to follow rpcrawtransaction.cpp in this regard? https://github.com/bitcoin/bitcoin/blob/master/src/rpcrawtransaction.cpp#L650
What compiler are you building with? I don't see any warnings.
- laanwj added the label Build system on Aug 14, 2014
-
laanwj commented at 8:53 AM on August 14, 2014: member
ACK. Clearly the brace grouping per record was missing. Looks like a correct change to me.
-
sipa commented at 9:38 AM on August 14, 2014: member
Untested ACK
- laanwj merged this on Aug 14, 2014
- laanwj closed this on Aug 14, 2014
- laanwj referenced this in commit 99170259d2 on Aug 14, 2014
-
jgarzik commented at 12:14 PM on August 14, 2014: contributor
It would have been nice to have a response to my feedback, before merging. That is the purpose of leaving feedback. I don't ask these questions just to hear myself talk.
The code in question came from rpcrawtransaction.cpp originally.
The change as merged diverges further from rpcrawtransaction, rather than converging.
-
laanwj commented at 12:51 PM on August 14, 2014: member
You do make a good point that the code is duplicated, though. It would be better to have this mapping only in one place.
-
jgarzik commented at 1:10 PM on August 14, 2014: contributor
Yes, the two pieces of code perform exactly the same function, and keeping the parsing interfaces unified is better long term.
-
theuni commented at 3:16 PM on August 14, 2014: member
@jgarzik sorry for not responding before merge. Warning comes from most compilers I tried, specifically g++ 4.7 I'm using now and shows it. I didn't look into how it was being used, just fixed the aggregate initialization as the compiler pointed out.
I can move findSighashFlags to a utility class somewhere, I agree that it's strange to find that implemented twice. Where would make the most sense?
- DrahtBot locked this on Sep 8, 2021