mastercoin-MSC / mastercore

mastercore info
mastercoin.org
MIT License
24 stars 11 forks source link

Fix, workaround for maybe uninitialized variables #179

Closed dexX7 closed 9 years ago

dexX7 commented 9 years ago

Warnings addressed:

mastercore_rpc.cpp:1515:10: warning: ‘valid’ may be used uninitialized in this function [-Wmaybe-uninitialized] mastercore_rpc.cpp:1845:9: warning: ‘MPTxTypeInt’ may be used uninitialized in this function [-Wmaybe-uninitialized]

I'm on another PR that aims to collect constants etc., so please don't mind the #define..

dexX7 commented 9 years ago

Note: rebased. Now it does, what it should.

m21 commented 9 years ago

@zathras-crypto @faizkhan00 not sure how they got introduced, thanks Dexx for noticing.

I am against adding new types to general-purpose global code (TYPE_UNDEFINED) to simply help with this RPC function. There is a logic problem in it somewhere and should be fixed locally. Probably same for "valid" -- it can be simply initialized to "false", IF it makes logical sense please. :)

dexX7 commented 9 years ago

Breaking populateRPCTransactionObject into parts and defining variables more locally would help.

But you were right, I found another path which builds without warning - PR updated.