Chris Mason posted on Fri, 22 Nov 2013 08:40:38 -0500 as excerpted: > Does gentoo modify the optimizations from the Makefile? We actually > have many strict-aliasing warnings, but I didn't think they came up > until -O2. > > At any rate, I'm adding -fno-strict-aliasing just to be sure.
FWIW, Gentoo lets users set their own CFLAGS/CXXFLAGS/LDFLAGS, etc. Gentoo recommends -O2 at the global system level and I believe sets that as the default before user modification, as well. -Os is considered a viable option, but users setting -O3 or -Ofast or whatever are often considered ricers and can be told to try to reproduce bugs with -O2 set. And -O1 or lower is not recommended either, simply because it's not widely tested. Individual package builds can and routinely do, however, override or filter specific flags where they've been demonstrated to be problematic, and in some cases, may add flags such as -fno-strict-aliasing where upstream code requires it. But of course a (normally masked unless a user specifically unmasks it) -9999 version is gentoo's way of noting a live-from-upstream-vcs version, and that's the case here as well. btrfs-progs-9999 fetches and builds the live-git btrfs-progs direct from upstream git, and as such, it's subject to far less QA than ~arch (~x86, ~amd64, etc) aka testing packages, which in turn are less stable-tested than stable arch (x86, amd64, etc) packages. Basically, gentooers unmasking -9999 packages are expected to be able to deal with any breakage a live-vcs build may have and/or trigger. And it's likely that -fno-strict-aliasing simply hasn't made it to the live build yet. But by the same token, I don't believe it'll override an upstream makefile's use of the flag, so now that you've added it... ... And indeed, after just rebuilding it here, with the commit (8116550) adding -fno-strict-aliasing as HEAD, I see no further type-punned pointer warnings. =:^) I do however still see this: cmds-restore.c: In function 'next_leaf': cmds-restore.c:174:20: warning: array subscript is above array bounds [- Warray-bounds] slot = path->slots[level] + 1; ^ (I am running a newer gcc than Martin, however: gcc (Gentoo 4.8.1-r1 p1.2, pie-0.5.7) 4.8.1 ) -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html