[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug cp-tools/67610] New: strcpy BUG
From: |
soekchl at 163 dot com |
Subject: |
[Bug cp-tools/67610] New: strcpy BUG |
Date: |
Thu, 17 Sep 2015 14:04:20 +0000 |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67610
Bug ID: 67610
Summary: strcpy BUG
Product: classpath
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: cp-tools
Assignee: unassigned at gcc dot gnu.org
Reporter: soekchl at 163 dot com
Target Milestone: ---
So easy programing , but the luck boy found a bug.Here is the gcc version of
the source code and the process and procedures for recording results.
And g++ have a same bug.
address@hidden:~/temp_source/201509/16$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --enable-targets=all --disable-werror
--with-arch-32=i686 --with-tune=generic --enable-checking=release
--build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
address@hidden:~/temp_source/201509/16$
address@hidden:~/temp_source/201509/16$ ls
a.out bigNum.c strcpy.c
address@hidden:~/temp_source/201509/16$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --enable-targets=all --disable-werror
--with-arch-32=i686 --with-tune=generic --enable-checking=release
--build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
address@hidden:~/temp_source/201509/16$ cat strcpy.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
char str[] = "0999998.000001";
puts(str);
strcpy(str, str+1);
puts(str);
return 0;
}
address@hidden:~/temp_source/201509/16$ gcc strcpy.c -Wall
address@hidden:~/temp_source/201509/16$ ./a.out
0999998.000001
9999980000001
address@hidden:~/temp_source/201509/16$
- [Bug cp-tools/67610] New: strcpy BUG,
soekchl at 163 dot com <=