[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#633352: gcc-4.4: function name incorrect in -Wstrict-overflow diagnostic



Package: gcc-4.4
Version: 4.4.5-8
Severity: minor


The shell script below reproduces this problem.  Notice that the
function name is incorrect (on my system the name shown is "T.4").  I
get this result when I run the script:

~$ sh t98.sh
t98.c: In function ‘T.4’:
t98.c:5: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C1 +- C2

I believe that correct output would be something like 
t98.c: In function ‘ff’:
t98.c:5: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C1 +- C2


Here is the script to reproduce the problem (I think it's minimal):


#! /bin/sh
cat >| t98.c <<EOF
#include <string.h>

static void ff (const char *dir)
{
  if (strcmp (".", dir))
    return;
  strdup (dir);
  strdup (dir);
}

int main (int argc, char **argv)
{
  ff ("hello");
  ff ("hello");
  return 0;
}
EOF
gcc -Wstrict-overflow -O2 -c  t98.c

I get the same effect with -m32 and -m64, though at -O3 the message is
correct, while at -O1 the warning isn't given at all.  Clearly not
passing -Wstrict-overflow will also silence the message.


-- System Information:
Debian Release: 6.0.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages gcc-4.4 depends on:
ii  binutils                      2.20.1-16  The GNU assembler, linker and bina
ii  cpp-4.4                       4.4.5-8    The GNU C preprocessor
ii  gcc-4.4-base                  4.4.5-8    The GNU Compiler Collection (base 
ii  libc6                         2.11.2-10  Embedded GNU C Library: Shared lib
ii  libgcc1                       1:4.4.5-8  GCC support library
ii  libgomp1                      4.4.5-8    GCC OpenMP (GOMP) support library

Versions of packages gcc-4.4 recommends:
ii  libc6-dev                     2.11.2-10  Embedded GNU C Library: Developmen

Versions of packages gcc-4.4 suggests:
ii  gcc-4.4-doc                  4.4.4.nf1-1 documentation for the GNU compiler
pn  gcc-4.4-locales              <none>      (no description available)
ii  gcc-4.4-multilib             4.4.5-8     The GNU C compiler (multilib files
pn  libcloog-ppl0                <none>      (no description available)
ii  libgcc1-dbg                  1:4.4.5-8   GCC support library (debug symbols
pn  libgomp1-dbg                 <none>      (no description available)
pn  libmudflap0-4.4-dev          <none>      (no description available)
pn  libmudflap0-dbg              <none>      (no description available)
pn  libppl-c2                    <none>      (no description available)
pn  libppl7                      <none>      (no description available)

-- no debconf information



Reply to: