This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix strict-aliasing warning in resolv/res_hconf.c
- From: Roland McGrath <roland at hack dot frob dot com>
- To: <sellcey at imgtec dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, Pedro Alves <palves at redhat dot com>, Andreas Schwab <schwab at suse dot de>, Paul Eggert <eggert at cs dot ucla dot edu>, <libc-alpha at sourceware dot org>
- Date: Thu, 28 May 2015 15:57:42 -0700 (PDT)
- Subject: Re: [PATCH] Fix strict-aliasing warning in resolv/res_hconf.c
- Authentication-results: sourceware.org; auth=none
- References: <5bfa6373-3817-4d31-a5ee-a8676e79b723 at BAMAIL02 dot ba dot imgtec dot org> <555BB55E dot 3050304 at cs dot ucla dot edu> <1432075989 dot 16668 dot 62 dot camel at ubuntu-sellcey> <555BC19B dot 90001 at cs dot ucla dot edu> <1432077972 dot 16668 dot 65 dot camel at ubuntu-sellcey> <20150519235817 dot 9516F2C3A73 at topped-with-meat dot com> <555C3E0B dot 2040404 at redhat dot com> <mvma8wzbqsv dot fsf at hawking dot suse dot de> <555C48F0 dot 2030208 at redhat dot com> <1432139240 dot 16668 dot 77 dot camel at ubuntu-sellcey> <55658C2A dot 70209 at redhat dot com> <5565B4D3 dot 3090401 at redhat dot com> <1432828842 dot 20199 dot 15 dot camel at ubuntu-sellcey> <20150528201038 dot 003B42C3B00 at topped-with-meat dot com> <1432850960 dot 20199 dot 25 dot camel at ubuntu-sellcey>
> I could, but I would rather not since I normally only build glibc for
> MIPS and it always takes me a while to figure out the options and
> settings for an x86 build. I did a build using GCC 4.9.2 for MIPS and
> did not see any significant code differences with this patch (i.e. I did
> not see an extra data copy on MIPS).
OK, that's good enough for me to assume that there won't be any extra data
copy on any machine with a reasonable compiler. (I actually asked about
x86_64 specifically because I wouldn't care about the MIPS code being
suboptimal as long as the x86 code was not.)
The only other thing I'd say about the patch is that the temporary
variable should be declared in the innermost possible scope.
Thanks,
Roland