{"action":"created","issue":{"url":"https://api.github.com/repos/BALL-Project/ball/issues/517","repository_url":"https://api.github.com/repos/BALL-Project/ball","labels_url":"https://api.github.com/repos/BALL-Project/ball/issues/517/labels{/name}","comments_url":"https://api.github.com/repos/BALL-Project/ball/issues/517/comments","events_url":"https://api.github.com/repos/BALL-Project/ball/issues/517/events","html_url":"https://github.com/BALL-Project/ball/issues/517","id":58307809,"number":517,"title":"Compile Error with GCC 4.8.2","user":{"login":"anhi","id":1349738,"avatar_url":"https://avatars.githubusercontent.com/u/1349738?v=3","gravatar_id":"","url":"https://api.github.com/users/anhi","html_url":"https://github.com/anhi","followers_url":"https://api.github.com/users/anhi/followers","following_url":"https://api.github.com/users/anhi/following{/other_user}","gists_url":"https://api.github.com/users/anhi/gists{/gist_id}","starred_url":"https://api.github.com/users/anhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anhi/subscriptions","organizations_url":"https://api.github.com/users/anhi/orgs","repos_url":"https://api.github.com/users/anhi/repos","events_url":"https://api.github.com/users/anhi/events{/privacy}","received_events_url":"https://api.github.com/users/anhi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/BALL-Project/ball/labels/C:%20BALL%20Core","name":"C: BALL Core","color":"0000aa"},{"url":"https://api.github.com/repos/BALL-Project/ball/labels/P:%20trivial","name":"P: trivial","color":"dce7ff"},{"url":"https://api.github.com/repos/BALL-Project/ball/labels/T:%20enhancement","name":"T: enhancement","color":"cccccc"}],"state":"closed","locked":false,"assignee":{"login":"anhi","id":1349738,"avatar_url":"https://avatars.githubusercontent.com/u/1349738?v=3","gravatar_id":"","url":"https://api.github.com/users/anhi","html_url":"https://github.com/anhi","followers_url":"https://api.github.com/users/anhi/followers","following_url":"https://api.github.com/users/anhi/following{/other_user}","gists_url":"https://api.github.com/users/anhi/gists{/gist_id}","starred_url":"https://api.github.com/users/anhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anhi/subscriptions","organizations_url":"https://api.github.com/users/anhi/orgs","repos_url":"https://api.github.com/users/anhi/repos","events_url":"https://api.github.com/users/anhi/events{/privacy}","received_events_url":"https://api.github.com/users/anhi/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-02-20T03:59:37Z","updated_at":"2016-04-29T16:27:33Z","closed_at":"2016-04-29T16:27:33Z","body":"**Reported by strunk on 23 Sep 43889757 00:20 UTC**\nI got a few compile errors, which I suspect to be 'actual' bugs in  Ball version 1.4.2.\r\n\r\nAmong others, this is the error:\r\n```\r\nPDBFileDetails.C:902:72: error: no matching function for call to BALL::NamedProperty::NamedProperty(const char [12], boost::shared_ptr<BALL::CrystalInfo>&)\r\n    current_protein_->setProperty(NamedProperty(\"CRYSTALINFO\", temp_ptr ));\r\n```\r\n\r\ntemp_ptr is of basetype:\r\n```\r\nboost::shared_ptr<BALL::PersistentObject>   \r\n```\r\n                                                          \r\nIn other words:\r\nNamedProperty(\"CRYSTALINFO\", temp_ptr ) is not 'found'. \r\ntemp_ptr is correctly set \r\n```\r\n    if (!(current_protein_->hasProperty(\"CRYSTALINFO\")))\r\n    {\r\n      boost::shared_ptr<CrystalInfo> temp_ptr(new CrystalInfo());\r\n      current_protein_->setProperty(NamedProperty(\"CRYSTALINFO\", temp_ptr ));\r\n    }\r\n```\r\n\r\nI guess, the reason is simple: temp_ptr is a temporary and the NamedProperty constructor expects a shared_ptr reference and not a copy. Non-const references to temporaries are not allowed. The outcome is more severe however: Being a shared pointer, the reference count upon passing as reference is not increased. If this code was compiled, the shared pointer would fall out of scope and the object would be destroyed.\r\n\r\nThe solution is very simple. As ownership of the shared_ptr is actually transfered to the NamedProperty (as long as the property exists, the object has to), the NamedProperty constructor should actually get a copy of the shared_ptr instead of a reference.\r\nIf this is desired, I would start creating a patch.\r\n\r\nBest,\r\nTimo"},"comment":{"url":"https://api.github.com/repos/BALL-Project/ball/issues/comments/215794205","html_url":"https://github.com/BALL-Project/ball/issues/517#issuecomment-215794205","issue_url":"https://api.github.com/repos/BALL-Project/ball/issues/517","id":215794205,"user":{"login":"tkemmer","id":1534428,"avatar_url":"https://avatars.githubusercontent.com/u/1534428?v=3","gravatar_id":"","url":"https://api.github.com/users/tkemmer","html_url":"https://github.com/tkemmer","followers_url":"https://api.github.com/users/tkemmer/followers","following_url":"https://api.github.com/users/tkemmer/following{/other_user}","gists_url":"https://api.github.com/users/tkemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/tkemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkemmer/subscriptions","organizations_url":"https://api.github.com/users/tkemmer/orgs","repos_url":"https://api.github.com/users/tkemmer/repos","events_url":"https://api.github.com/users/tkemmer/events{/privacy}","received_events_url":"https://api.github.com/users/tkemmer/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T16:27:33Z","updated_at":"2016-04-29T16:27:33Z","body":"Should be fixed with e7cc50705bed20e160bd4b637b23f57270f580a8."}}