{"action":"created","issue":{"url":"https://api.github.com/repos/hughsie/fwupd/issues/43","repository_url":"https://api.github.com/repos/hughsie/fwupd","labels_url":"https://api.github.com/repos/hughsie/fwupd/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/hughsie/fwupd/issues/43/comments","events_url":"https://api.github.com/repos/hughsie/fwupd/issues/43/events","html_url":"https://github.com/hughsie/fwupd/issues/43","id":145292882,"number":43,"title":"Test Suite fails on big endian architectures","user":{"login":"superm1","id":494526,"avatar_url":"https://avatars.githubusercontent.com/u/494526?v=3","gravatar_id":"","url":"https://api.github.com/users/superm1","html_url":"https://github.com/superm1","followers_url":"https://api.github.com/users/superm1/followers","following_url":"https://api.github.com/users/superm1/following{/other_user}","gists_url":"https://api.github.com/users/superm1/gists{/gist_id}","starred_url":"https://api.github.com/users/superm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superm1/subscriptions","organizations_url":"https://api.github.com/users/superm1/orgs","repos_url":"https://api.github.com/users/superm1/repos","events_url":"https://api.github.com/users/superm1/events{/privacy}","received_events_url":"https://api.github.com/users/superm1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-04-01T21:47:19Z","updated_at":"2016-04-03T08:45:46Z","closed_at":null,"body":"Since turning on the test suite in Launchpad builds, it was apparent that there are some assumptions made in the code about endian-ness (signed vs unsigned comparisons and such).  A few warnings in those architectures builds stand out:\r\n\r\n```\r\ngcc -DHAVE_CONFIG_H -I. -I..  -pthread -I/usr/include/libappstream-glib -I/usr/include/libgcab-1.0 -I/usr/include/uuid -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/powerpc-linux-gnu/glib-2.0/include -pthread -I/usr/include/colord-1/colorhug -I/usr/include/gusb-1 -I/usr/include/libusb-1.0 -I/usr/include/colord-1 -I/usr/include/glib-2.0 -I/usr/lib/powerpc-linux-gnu/glib-2.0/include -pthread -I/usr/include/gusb-1 -I/usr/include/glib-2.0 -I/usr/lib/powerpc-linux-gnu/glib-2.0/include -I/usr/include/libusb-1.0 -pthread -I/usr/include/libgcab-1.0 -I/usr/include/glib-2.0 -I/usr/lib/powerpc-linux-gnu/glib-2.0/include -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/powerpc-linux-gnu/glib-2.0/include -I/usr/include/gudev-1.0 -I/usr/include/glib-2.0 -I/usr/lib/powerpc-linux-gnu/glib-2.0/include -fPIE -pthread -I/usr/include/polkit-1 -I/usr/include/glib-2.0 -I/usr/lib/powerpc-linux-gnu/glib-2.0/include   -pthread -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/powerpc-linux-gnu/glib-2.0/include  -I.. -I.. -I../libfwupd -DG_LOG_DOMAIN=\\\"Fu\\\" -DLIBEXECDIR=\\\"/usr/lib/powerpc-linux-gnu\\\" -DLIBDIR=\\\"/usr/lib/powerpc-linux-gnu\\\" -DDATADIR=\\\"/usr/share\\\" -DSYSCONFDIR=\\\"\"/etc\"\\\" -DVERSION=\"\\\"0.7.0\\\"\" -DDAEMON_USER=\"\\\"\\\"\" -DTESTDATADIR=\\\"\"../data/tests\"\\\" -DG_UDEV_API_IS_SUBJECT_TO_CHANGE -DLOCALEDIR=\\\"\"/usr/share/locale\"\\\" -Wdate-time -D_FORTIFY_SOURCE=2 -DFU_OFFLINE_DESTDIR=\\\"\\\" -DLOCALSTATEDIR=\\\"\"/var\"\\\" -Wall -Wcast-align -Wno-uninitialized -Wmissing-declarations -Wpointer-arith -Wcast-align -Wwrite-strings -Winit-self -Wreturn-type -Wformat-nonliteral -Wformat-security -Wmissing-include-dirs -Wmissing-format-attribute -Wclobbered -Wempty-body -Wignored-qualifiers -Wsign-compare -Wtype-limits -Wuninitialized -Waggregate-return -Wdeclaration-after-statement -Wshadow -Wno-strict-aliasing -Winline -Wmissing-parameter-type -Woverride-init -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -c -o fwupdmgr-fu-rom.o `test -f 'fu-rom.c' || echo './'`fu-rom.c\r\nIn file included from /usr/include/glib-2.0/glib.h:62:0,\r\n                 from /usr/include/glib-2.0/gobject/gbinding.h:28,\r\n                 from /usr/include/glib-2.0/glib-object.h:23,\r\n                 from ../libfwupd/fwupd-client.h:25,\r\n                 from ../libfwupd/fwupd.h:32,\r\n                 from fu-rom.c:24:\r\nfu-rom.c: In function ‘fu_rom_find_and_blank_serial_numbers’:\r\nfu-rom.c:386:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘int’ [-Wformat=]\r\n    g_debug (\"cleared %i chars @ 0x%04lx\", len, tmp - &hdr->rom_data[hdr->data_len]);\r\n             ^\r\n/usr/include/glib-2.0/glib/gmessages.h:170:32: note: in definition of macro ‘g_debug’\r\n                                __VA_ARGS__)\r\n                                ^\r\nfu-rom.c: In function ‘fu_rom_load_file’:\r\nfu-rom.c:712:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]\r\n  while (sz > hdr_sz + jump) {\r\n            ^\r\nfu-rom.c:785:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]\r\n  if (hdr_sz > sz) {\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/hughsie/fwupd/issues/comments/204915415","html_url":"https://github.com/hughsie/fwupd/issues/43#issuecomment-204915415","issue_url":"https://api.github.com/repos/hughsie/fwupd/issues/43","id":204915415,"user":{"login":"hughsie","id":151380,"avatar_url":"https://avatars.githubusercontent.com/u/151380?v=3","gravatar_id":"","url":"https://api.github.com/users/hughsie","html_url":"https://github.com/hughsie","followers_url":"https://api.github.com/users/hughsie/followers","following_url":"https://api.github.com/users/hughsie/following{/other_user}","gists_url":"https://api.github.com/users/hughsie/gists{/gist_id}","starred_url":"https://api.github.com/users/hughsie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughsie/subscriptions","organizations_url":"https://api.github.com/users/hughsie/orgs","repos_url":"https://api.github.com/users/hughsie/repos","events_url":"https://api.github.com/users/hughsie/events{/privacy}","received_events_url":"https://api.github.com/users/hughsie/received_events","type":"User","site_admin":false},"created_at":"2016-04-03T08:45:46Z","updated_at":"2016-04-03T08:45:46Z","body":"I've fixed up your commit (it was an endian write issue, not read) -- I think I'd prefer to review these sorts of commits before you push them to master if that's okay. We don't have any release pressure now, so we can take things a bit slower.\r\n\r\nI'm struggling to work out why the dfu_firmware_get_size() is returning the size of the (firmware+footer) on BE and just (firmware) on LE. Ideas welcome! Also, the dfuse header stuff looks wildly endlan-unsafe, so that'll likely explode too."}}