From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29160 invoked by alias); 23 May 2014 15:29:24 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 29117 invoked by uid 48); 23 May 2014 15:29:20 -0000 From: "orion at cora dot nwra.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61294] New: [4.9 Regression] erroneous memset used with constant zero length parameter warning Date: Fri, 23 May 2014 15:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: orion at cora dot nwra.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-05/txt/msg02088.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61294 Bug ID: 61294 Summary: [4.9 Regression] erroneous memset used with constant zero length parameter warning Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: orion at cora dot nwra.com Created attachment 32846 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32846&action=edit preprocessed test case $ g++ -std=c++11 -O2 -c test.cxx In function 'void* memset(void*, int, size_t)', inlined from 'static void vtkDistributedDataFilter::AddConstantUnsignedCharPointArray(vtkUnstructuredGrid*, const char*, unsigned char)' at test.cxx:31883:29: test.cxx:15303:32: warning: call to '__warn_memset_zero_len' declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters __warn_memset_zero_len (); ^ # g++ -v Using built-in specs. COLLECT_GCC=/usr/bin/g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.9.0/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.9.0-20140518/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.9.0-20140518/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.9.0 20140518 (Red Hat 4.9.0-5) (GCC) No warning with 4.8.2 (or without -O2)