Solidity: Require "storage" keyword for local variables.

Created on 21 Jun 2017  路  11Comments  路  Source: ethereum/solidity

breaking change

Most helpful comment

Someone please tell me how to update this smart contract so it compiles without warning.

A tutorial that thousands of people use was broken by this change:

https://raw.githubusercontent.com/Tectract/ethereum-demo-tools/master/GeektSolidity/contracts/Geekt.sol

All 11 comments

Someone please tell me how to update this smart contract so it compiles without warning.

A tutorial that thousands of people use was broken by this change:

https://raw.githubusercontent.com/Tectract/ethereum-demo-tools/master/GeektSolidity/contracts/Geekt.sol

[":15:5: Warning: Variable is declared as a storage pointer. Use an explicit \"storage\" keyword to silence this warning.\n string imageURL;\n ^-------------^\n",":20:5: Warning: Variable is declared as a storage pointer. Use an explicit \"storage\" keyword to silence this warning.\n string handle;\n ^-----------^\n",":24:5: Warning: Variable is declared as a storage pointer. Use an explicit \"storage\" keyword to silence this warning.\n bytes32[] myImages;\n ^----------------^\n"]

Has this been solved? Im having the same issue.

I ended up just making my compile tool display but ignore warnings. There was a big long thread about this, lol. I think this specific erroneous error / warning was fixed, but the real problem is that errors can be kicked back as "warnings" and there's no way to differentiate the two, and sometimes they accept PRs which may kick up erroneous error / warning messages, and that's just a reality of programming.

https://github.com/ethereum/solidity/issues/2525

@Tectract and how did you ignore the warnings? are you using Mist or Ethereum Wallet?

I wrote my own in-browser compile and deploy tool, lol. See the "secret crazy bonus section" at the end of my article, here:

https://blockgeeks.com/guides/how-to-learn-solidity/

@magonicolas there is a perfectly fine way to receive a detailed list of errors/warnings with a severity flag (set to either error or warning). See https://solidity.readthedocs.io/en/develop/using-the-compiler.html#compiler-input-and-output-json-description

Also please discuss this on a relevant issue, since this one has a different purpose.

For history, can someone please share the old contract that has the warning (preferably as a minimal test case).

This was the original contract, can't really remember which line this pertained to at the moment:

https://raw.githubusercontent.com/Tectract/ethereum-demo-tools/master/GeektSolidity/contracts/Geekt.sol

Thank you, that's the one I saw. In the current Solidity, I cannot find that warning anymore :-p

Was this page helpful?
0 / 5 - 0 ratings