[Bug 767522] New: correct memset call results in "=?UTF-8?Q?call=20to=20=E2=80=98=5F=5Fwarn=5Fmemset=5Fzero=5Flen=E2=80=99=20declared=20with=20attribute=20warning?=" message
https://bugzilla.novell.com/show_bug.cgi?id=767522
https://bugzilla.novell.com/show_bug.cgi?id=767522#c0
Summary: correct memset call results in "call to
‘__warn_memset_zero_len’ declared with attribute
warning" message
Classification: openSUSE
Product: openSUSE 12.2
Version: Factory
Platform: Other
OS/Version: Other
Status: NEW
Severity: Minor
Priority: P5 - None
Component: Other
AssignedTo: rguenther@suse.com
ReportedBy: christian.morales.vega@gmail.com
QAContact: qa-bugs@suse.de
Found By: Community User
Blocker: ---
libmlt build log from multimedia:libs shows some warnings
W: libmlt memset-with-zero-length filter_invert.c:62:10
W: libmlt memset-with-zero-length filter_resize.c:261:30
W: libmlt memset-with-zero-length filter_rotoscoping.c:237:11
W: libmlt memset-with-zero-length filter_rotoscoping.c:264:23
W: libmlt memset-with-zero-length filter_rotoscoping.c:414:31
W: libmlt memset-with-zero-length mlt_frame.c:527:12
W: libmlt memset-with-zero-length mlt_frame.c:535:12
W: libmlt memset-with-zero-length mlt_frame.c:553:12
W: libmlt memset-with-zero-length mlt_frame.c:584:10
W: libmlt memset-with-zero-length producer_colour.c:220:9
W: libmlt memset-with-zero-length transition_composite.c:1243:11
W: libmlt memset-with-zero-length transition_composite.c:1246:11
That don't seem to make sense (for reference use mlt_frame.c...)
Even this basic case:
------------------------------------------------------------------
#include
https://bugzilla.novell.com/show_bug.cgi?id=767522
https://bugzilla.novell.com/show_bug.cgi?id=767522#c1
Richard Guenther
In both 12.1 and Factory. If I compile it with: gcc -D_FORTIFY_SOURCE=2 -O1 -fno-tree-dominator-opts -o test test.c
"Doctor, it hurts when I do this!" well, then don't do it. Fact is that due to -fno-tree-dominator-opts (which would perform constant propagation) when we finally give up and decide that the length argument is not constant, nothing propagates this fact to the conditional and thus we end up with D.3393_19 = 0; // was: __builtin_constant_p (length) if (D.3393_19 != 0) { if (length == 0) __warn_memset_zero_len (); else __builtin_memset (D.3362_7, 255, length); } you simply get what you have asked for - fortification warnigns rely on GCC performing simple optimizations - if you disable those you break their efficiency and get this kind of false positives. To quote the glibc header: /* The first two tests here help to catch a somewhat common problem where the second and third parameter are transposed. This is especially problematic if the intended fill value is zero. In this case no work is done at all. We detect these problems by referring non-existing functions. */ __extern_always_inline void * __NTH (memset (void *__dest, int __ch, size_t __len)) { if (__builtin_constant_p (__len) && __len == 0 && (!__builtin_constant_p (__ch) || __ch != 0)) { __warn_memset_zero_len (); return __dest; } return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest)); } Please never disable selected optimization passes - this kind of disabling does not receive good testing and is likely causing more problems than it helps. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=767522
https://bugzilla.novell.com/show_bug.cgi?id=767522#c2
--- Comment #2 from Cristian Morales Vega
https://bugzilla.novell.com/show_bug.cgi?id=767522
https://bugzilla.novell.com/show_bug.cgi?id=767522#c3
--- Comment #3 from Richard Guenther
OK, so I will ask MLT devs why they put it there. But there is no reason to think right now there is something really wrong, true?
True. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com