{"action":"created","issue":{"url":"https://api.github.com/repos/sgieseking/anyrpc/issues/4","repository_url":"https://api.github.com/repos/sgieseking/anyrpc","labels_url":"https://api.github.com/repos/sgieseking/anyrpc/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/sgieseking/anyrpc/issues/4/comments","events_url":"https://api.github.com/repos/sgieseking/anyrpc/issues/4/events","html_url":"https://github.com/sgieseking/anyrpc/issues/4","id":155736384,"number":4,"title":"Warnings caused by type conversion","user":{"login":"JanPlitzkow","id":7890485,"avatar_url":"https://avatars.githubusercontent.com/u/7890485?v=3","gravatar_id":"","url":"https://api.github.com/users/JanPlitzkow","html_url":"https://github.com/JanPlitzkow","followers_url":"https://api.github.com/users/JanPlitzkow/followers","following_url":"https://api.github.com/users/JanPlitzkow/following{/other_user}","gists_url":"https://api.github.com/users/JanPlitzkow/gists{/gist_id}","starred_url":"https://api.github.com/users/JanPlitzkow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanPlitzkow/subscriptions","organizations_url":"https://api.github.com/users/JanPlitzkow/orgs","repos_url":"https://api.github.com/users/JanPlitzkow/repos","events_url":"https://api.github.com/users/JanPlitzkow/events{/privacy}","received_events_url":"https://api.github.com/users/JanPlitzkow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-19T13:27:13Z","updated_at":"2016-05-19T14:22:53Z","closed_at":null,"body":"Hello,\r\nI'm using the AnyRPC under Win7 with Visual Studio 2015. The target application shall be compiled for 32bit and 64bit. During compilation some warnings of this kind occur:\r\nwarning C4267: 'var' : conversion from 'size_t' to 'type', possible loss of data\r\n\r\nUnder 32bit it's only 'size_t' to 'char' having problems, and the position in code can easily be handled with a simple static_cast. However, under 64bit it's also 'size_t' to 'int', 'size_t' to 'uint32_t' and others. Most of the calls refer to arguments passed between different string functions.\r\n\r\nExample:\r\n```\r\n    //! Copy the string as either a short string or with allocated memory.\r\n    void CopyString(const char* s) { CopyString(s, strlen(s)); }\r\n    //! Copy the string as either a short string or with allocated memory.\r\n    void CopyString(const char* s, int length);\r\n```\r\nstrlen(s) returns a size_t, while CopyString takes an int.\r\nDoes the anyrpc library fully support 64 bit or might I run into problems later on? Any hints / comments on how to solve this warning in a most appropriate way?\r\n"},"comment":{"url":"https://api.github.com/repos/sgieseking/anyrpc/issues/comments/220339464","html_url":"https://github.com/sgieseking/anyrpc/issues/4#issuecomment-220339464","issue_url":"https://api.github.com/repos/sgieseking/anyrpc/issues/4","id":220339464,"user":{"login":"sgieseking","id":6330323,"avatar_url":"https://avatars.githubusercontent.com/u/6330323?v=3","gravatar_id":"","url":"https://api.github.com/users/sgieseking","html_url":"https://github.com/sgieseking","followers_url":"https://api.github.com/users/sgieseking/followers","following_url":"https://api.github.com/users/sgieseking/following{/other_user}","gists_url":"https://api.github.com/users/sgieseking/gists{/gist_id}","starred_url":"https://api.github.com/users/sgieseking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgieseking/subscriptions","organizations_url":"https://api.github.com/users/sgieseking/orgs","repos_url":"https://api.github.com/users/sgieseking/repos","events_url":"https://api.github.com/users/sgieseking/events{/privacy}","received_events_url":"https://api.github.com/users/sgieseking/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T14:22:53Z","updated_at":"2016-05-19T14:22:53Z","body":"Thanks for trying AnyRPC.\r\n\r\nI'll look into this a bit more but my initial guess is that it will not cause any problems as long as the size of the various data items being transported are less than 2^31 bytes which would probably cause other buffering problems.\r\n\r\nUnder Windows x64 compilations, size_t is uint64_t, but it is being assigned to variables that are int or uint32_t.  The automatic conversion will only be a problem if the actual data is greater than 2^31 or 2^32 depending on the assignment.  \r\n\r\nThe code should be more explicit about these conversions to prevent the warning message but it also depends on the compiler and OS being used.  "}}