{"action":"created","issue":{"url":"https://api.github.com/repos/sstephenson/ruby-build/issues/325","labels_url":"https://api.github.com/repos/sstephenson/ruby-build/issues/325/labels{/name}","comments_url":"https://api.github.com/repos/sstephenson/ruby-build/issues/325/comments","events_url":"https://api.github.com/repos/sstephenson/ruby-build/issues/325/events","html_url":"https://github.com/sstephenson/ruby-build/issues/325","id":11849571,"number":325,"title":"gcc does not support \"-Wno-error=shorten-64-to-32\"","user":{"login":"quark-zju","id":445459,"avatar_url":"https://avatars.githubusercontent.com/u/445459?v=3","gravatar_id":"","url":"https://api.github.com/users/quark-zju","html_url":"https://github.com/quark-zju","followers_url":"https://api.github.com/users/quark-zju/followers","following_url":"https://api.github.com/users/quark-zju/following{/other_user}","gists_url":"https://api.github.com/users/quark-zju/gists{/gist_id}","starred_url":"https://api.github.com/users/quark-zju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quark-zju/subscriptions","organizations_url":"https://api.github.com/users/quark-zju/orgs","repos_url":"https://api.github.com/users/quark-zju/repos","events_url":"https://api.github.com/users/quark-zju/events{/privacy}","received_events_url":"https://api.github.com/users/quark-zju/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2013-03-10T07:48:27Z","updated_at":"2015-10-11T18:26:29Z","closed_at":"2013-04-26T21:27:31Z","body":"ruby-build script contains following workaround for clang:\r\n\r\n```bash\r\n# Work around warnings building Ruby 2.0 on Clang 2.x\r\nif type clang &>/dev/null; then\r\n  if \"${CC:-clang}\" -x c /dev/null -E -Wno-error=shorten-64-to-32 &>/dev/null; then\r\n    RUBY_CFLAGS=\"$RUBY_CFLAGS -Wno-error=shorten-64-to-32\"\r\n  fi\r\nfi\r\n```\r\n\r\nIf both gcc and clang installed and `cc` is `gcc`, the above workaround will be triggered wrongly and result in failing to compile anything:\r\n\r\n```\r\nconfigure:3741: checking whether the C compiler works\r\nconfigure:3763: gcc   -Wno-error=shorten-64-to-32 -I'/home/quark/.rbenv/versions/2.0.0-p0/include'  -L'/home/quark/.rbenv/versions/2.0.0-p0/lib'  conftest.c  >&5\r\ncc1: error: -Werror=shorten-64-to-32: no option -Wshorten-64-to-32\r\nconfigure:3767: $? = 1\r\nconfigure:3805: result: no\r\nconfigure: failed program was:\r\n| /* confdefs.h */\r\n| #define PACKAGE_NAME \"\"\r\n| #define PACKAGE_TARNAME \"\"\r\n| #define PACKAGE_VERSION \"\"\r\n| #define PACKAGE_STRING \"\"\r\n| #define PACKAGE_BUGREPORT \"\"\r\n| #define PACKAGE_URL \"\"\r\n| #define CANONICALIZATION_FOR_MATHN 1\r\n| #define RUBY_BASE_NAME \"ruby\" !<verconf>!\r\n| #define RUBY_VERSION_NAME RUBY_BASE_NAME\"-\"RUBY_LIB_VERSION !<verconf>!\r\n| /* end confdefs.h.  */\r\n| \r\n| int\r\n| main ()\r\n| {\r\n| \r\n|   ;\r\n|   return 0;\r\n| }\r\nconfigure:3810: error: in `/tmp/ruby-build.20130310154119.10022/ruby-2.0.0-p0':\r\nconfigure:3812: error: C compiler cannot create executables\r\nSee `config.log' for more details\r\n```\r\n\r\nHow about changing `${CC:-clang}` to `${CC:-cc}` in the workaround script?"},"comment":{"url":"https://api.github.com/repos/sstephenson/ruby-build/issues/comments/147233080","html_url":"https://github.com/sstephenson/ruby-build/issues/325#issuecomment-147233080","issue_url":"https://api.github.com/repos/sstephenson/ruby-build/issues/325","id":147233080,"user":{"login":"mislav","id":887,"avatar_url":"https://avatars.githubusercontent.com/u/887?v=3","gravatar_id":"","url":"https://api.github.com/users/mislav","html_url":"https://github.com/mislav","followers_url":"https://api.github.com/users/mislav/followers","following_url":"https://api.github.com/users/mislav/following{/other_user}","gists_url":"https://api.github.com/users/mislav/gists{/gist_id}","starred_url":"https://api.github.com/users/mislav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mislav/subscriptions","organizations_url":"https://api.github.com/users/mislav/orgs","repos_url":"https://api.github.com/users/mislav/repos","events_url":"https://api.github.com/users/mislav/events{/privacy}","received_events_url":"https://api.github.com/users/mislav/received_events","type":"User","site_admin":true},"created_at":"2015-10-11T18:26:29Z","updated_at":"2015-10-11T18:26:29Z","body":"@Nakilon That's strange. This is what ruby-build has right now:\r\n\r\n```sh\r\nif \"${CC:-cc}\" -x c /dev/null -E -Wno-error=shorten-64-to-32 &>/dev/null; then\r\n  RUBY_CFLAGS=\"-O3 -Wno-error=shorten-64-to-32 $RUBY_CFLAGS\"\r\nfi\r\n```\r\n\r\nWhat state was your file in, and what did you have to remove?"}}