Public bug reported:

When building kdenetwork 4.8.3 in quantal with the default options, it
fails with (fatal-warnings is used):

/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crtn.oCMakeFiles/kopete_qq.dir/evautil.o:
 In function `memset':
/usr/include/x86_64-linux-gnu/bits/string3.h:82: warning: memset used with 
constant zero length parameter; this could be due to transposed parameters
collect2: error: ld returned 1 exit status

The relevant code would be:
ByteArray Packet::encrypt( const ByteArray& text, const ByteArray& key )
{
int pos, len, i;
</snip>
               pos = ( text.size() + 10 ) % 8;
                if( pos )
                        pos = 8 - pos;
                // Prepare the first 8 bytes:
                plain[0] = ( rand() & 0xf8 ) | pos;
                memset( plain_pre, 0, 8 );
                memset( crypted_pre, 0, 8 );
                memset( plain+1, rand()& 0xff, pos++ );
</snip>
ByteArray is defined in libeva.h
The third memset seems to fail (I commented the others out to make sure), but 
pos is not a constant value so it makes no sense that g++ evaluates it to 
constant 0.
This does NOT happen if you build with -O0 by setting DEB_BUILD_OPTIONS=noop

Attached is a build log with -Wl,--verbose if it helps.

ProblemType: BugDistroRelease: Ubuntu 12.10
Package: gcc-4.7 4.7.0-7ubuntu3 [modified: usr/bin/gcc-4.7]
ProcVersionSignature: Ubuntu 3.2.0-24.38-generic 3.2.16
Uname: Linux 3.2.0-24-generic x86_64
NonfreeKernelModules: vboxpci vboxnetadp vboxnetflt vboxdrv
ApportVersion: 2.1-0ubuntu1
Architecture: amd64
Date: Sun May 20 21:02:26 2012
InstallationMedia: Kubuntu 11.10 "Oneiric Ocelot" - Beta amd64 (20111007)
ProcEnviron:
 SHELL=/bin/bash
 TERM=screen
 PATH=(custom, user)
 LANG=en_US.UTF-8
 LANGUAGE=en_US.UTF-8SourcePackage: gcc-4.7
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: gcc-4.7 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug quantal

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1002030

Title:
  kdenetwork 4.8.3 fails to build with gcc 4.7 and level 2 optimizations

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.7/+bug/1002030/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to