[Bug libc/14210] warning when using FD_SET() with -Wsign-conversion and _FORTIFY_SOURCE
ppluzhnikov at google dot com
sourceware-bugzilla@sourceware.org
Sat Jun 9 16:49:00 GMT 2012
http://sourceware.org/bugzilla/show_bug.cgi?id=14210
--- Comment #4 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2012-06-09 16:49:09 UTC ---
(In reply to comment #3)
> i think that version though generates worse code than casting the
> signed value to an unsigned and leaving all the checks to doing a single
> compare.
In my x86_64 build, the code for __fdelt_chk is identical before/after the
patch:
(gdb) disas __fdelt_chk
Dump of assembler code for function __fdelt_chk:
0x00000000000fb910 <+0>: cmp $0x3ff,%rdi
0x00000000000fb917 <+7>: ja 0xfb921 <__fdelt_chk+17>
0x00000000000fb919 <+9>: mov %rdi,%rax
0x00000000000fb91c <+12>: shr $0x6,%rax
0x00000000000fb920 <+16>: retq
0x00000000000fb921 <+17>: push %rax
0x00000000000fb922 <+18>: callq 0xf9a60 <__GI___chk_fail>
End of assembler dump.
The other part -- macro expansion -- is a compile-time check, so it doesn't
matter.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list