public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/56703] New: problems with strsignal and maybe strstr due to varying const on return type
@ 2013-03-23 23:06 jay.krell at cornell dot edu
  2013-03-23 23:12 ` [Bug bootstrap/56703] " jay.krell at cornell dot edu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jay.krell at cornell dot edu @ 2013-03-23 23:06 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56703

             Bug #: 56703
           Summary: problems with strsignal and maybe strstr due to
                    varying const on return type
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jay.krell@cornell.edu


The autoconf checks for strsignal and maybe strstr are overly strict or wrong
and fail due to varying const on the return.


gcc 4.8.0

 uname -a
SunOS unstable10s 5.10 Generic_147440-27 sun4v sparc
SUNW,SPARC-Enterprise-T5220


make[3]: Entering directory `/home/jkrell/obj/gcc480-sparc-sun-solaris2.10/gcc'
/home/jkrell/obj/gcc480-sparc-sun-solaris2.10/./prev-gcc/xg++
-B/home/jkrell/obj/gcc480-sparc-sun-solaris2.10/./prev-gcc/
-B/home/jkrell/gcc480-sparc-sun-solaris2.10/sparc-sun-solaris2.10/bin/
-nostdinc++
-B/home/jkrell/obj/gcc480-sparc-sun-solaris2.10/prev-sparc-sun-solaris2.10/libstdc++-v3/src/.libs
-B/home/jkrell/obj/gcc480-sparc-sun-solaris2.10/prev-sparc-sun-solaris2.10/libstdc++-v3/libsupc++/.libs
-I/home/jkrell/obj/gcc480-sparc-sun-solaris2.10/prev-sparc-sun-solaris2.10/libstdc++-v3/include/sparc-sun-solaris2.10
-I/home/jkrell/obj/gcc480-sparc-sun-solaris2.10/prev-sparc-sun-solaris2.10/libstdc++-v3/include
-I/home/jkrell/src/gcc-4.8.0/libstdc++-v3/libsupc++
-L/home/jkrell/obj/gcc480-sparc-sun-solaris2.10/prev-sparc-sun-solaris2.10/libstdc++-v3/src/.libs
-L/home/jkrell/obj/gcc480-sparc-sun-solaris2.10/prev-sparc-sun-solaris2.10/libstdc++-v3/libsupc++/.libs
-c   -g -O2 -DIN_GCC   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables
-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings  
-DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I/home/jkrell/src/gcc-4.8.0/gcc
-I/home/jkrell/src/gcc-4.8.0/gcc/build
-I/home/jkrell/src/gcc-4.8.0/gcc/../include -I./../intl
-I/home/jkrell/src/gcc-4.8.0/gcc/../libcpp/include 
-I/home/jkrell/src/gcc-4.8.0/gcc/../libdecnumber
-I/home/jkrell/src/gcc-4.8.0/gcc/../libdecnumber/dpd -I../libdecnumber
-I/home/jkrell/src/gcc-4.8.0/gcc/../libbacktrace    \
        -o build/genconstants.o /home/jkrell/src/gcc-4.8.0/gcc/genconstants.c
In file included from ./bconfig.h:3:0,
                 from /home/jkrell/src/gcc-4.8.0/gcc/genconstants.c:27:
./auto-host.h:1994:16: error: declaration does not declare anything
[-fpermissive]
 #define rlim_t long
                ^
In file included from /home/jkrell/src/gcc-4.8.0/gcc/genconstants.c:28:0:
/home/jkrell/src/gcc-4.8.0/gcc/system.h:448:48: error: 'char* strstr(const
char*, const char*)' conflicts with previous using declaration 'const char*
std::strstr(const char*, const char*)'
 extern char *strstr (const char *, const char *);
                                                ^
In file included from /home/jkrell/src/gcc-4.8.0/gcc/genconstants.c:28:0:
/home/jkrell/src/gcc-4.8.0/gcc/system.h:500:34: error: declaration of C
function 'const char* strsignal(int)' conflicts with
 extern const char *strsignal (int);
                                  ^
In file included from
/home/jkrell/obj/gcc480-sparc-sun-solaris2.10/prev-sparc-sun-solaris2.10/libstdc++-v3/include/cstring:42:0,
                 from /home/jkrell/src/gcc-4.8.0/gcc/system.h:205,
                 from /home/jkrell/src/gcc-4.8.0/gcc/genconstants.c:28:
/usr/include/string.h:79:14: error: previous declaration 'char* strsignal(int)'
here
 extern char *strsignal(int);
              ^
gmake[3]: *** [build/genconstants.o] Error 1
gmake[3]: Leaving directory `/home/jkrell/obj/gcc480-sparc-sun-solaris2.10/gcc'
gmake[2]: *** [all-stage2-gcc] Error 2
gmake[2]: Leaving directory `/home/jkrell/obj/gcc480-sparc-sun-solaris2.10'
gmake[1]: *** [stage2-bubble] Error 2
gmake[1]: Leaving directory `/home/jkrell/obj/gcc480-sparc-sun-solaris2.10'
gmake: *** [all] Error 2
jkrell@unstable10s [unstable10s]:~/obj/gcc480-sparc-sun-solaris2.10 > 


Both the strstr and strsignal declarations in system.h have autoconf #if's
around them.
One wonders why they evaluate to true.


krell@unstable10s [unstable10s]:~/obj/gcc480-sparc-sun-solaris2.10 > grep STRS
*/*h
gcc/auto-host.h:#define HAVE_DECL_STRSIGNAL 0
gcc/auto-host.h:#define HAVE_DECL_STRSTR 0
gcc/auto-host.h:#define HAVE_STRSIGNAL 1
libiberty/config.h:#define HAVE_STRSIGNAL 1
libiberty/config.h:#define HAVE_STRSTR 1
prev-gcc/auto-host.h:#define HAVE_DECL_STRSIGNAL 1
prev-gcc/auto-host.h:#define HAVE_DECL_STRSTR 1
prev-gcc/auto-host.h:#define HAVE_STRSIGNAL 1


The mystery deepens...
cd gcc
vi config.log
...

| #undef HAVE_DECL_STRSIGNAL
| #define HAVE_DECL_STRSIGNAL 1
|
| #include "ansidecl.h"
| #include "system.h"
|
| int
| main ()
| {
| #ifndef strsignal
| char *(*pfn) = (char *(*)) strsignal ;
| #endif
|   ;
|   return 0;
| }
configure:10374: result: no
configure:10336: checking whether strstr is declared
configure:10359:  /home/jkrell/obj/gcc480-sparc-sun-solaris2.10/./prev-gcc/xgcc
-B/home/jkrell/obj/gcc4
80-sparc-sun-solaris2.10/./prev-gcc/
-B/home/jkrell/gcc480-sparc-sun-solaris2.10/sparc-sun-solaris2.10/
bin/ -B/home/jkrell/gcc480-sparc-sun-solaris2.10/sparc-sun-solaris2.10/bin/
-B/home/jkrell/gcc480-sparc
-sun-solaris2.10/sparc-sun-solaris2.10/lib/ -isystem
/home/jkrell/gcc480-sparc-sun-solaris2.10/sparc-su
n-solaris2.10/include -isystem
/home/jkrell/gcc480-sparc-sun-solaris2.10/sparc-sun-solaris2.10/sys-incl
ude    -c -g -O2 -I/home/jkrell/src/gcc-4.8.0/gcc
-I/home/jkrell/src/gcc-4.8.0/gcc/../include   conftes
t.c >&5
In file included from conftest.c:116:0:
/home/jkrell/src/gcc-4.8.0/gcc/system.h:500:20: error: conflicting types for
'strsignal'
 extern const char *strsignal (int);
                    ^
In file included from /home/jkrell/src/gcc-4.8.0/gcc/system.h:213:0,
                 from conftest.c:116:
/usr/include/string.h:79:14: note: previous declaration of 'strsignal' was here
 extern char *strsignal(int);
              ^
In file included from conftest.c:116:0:
/home/jkrell/src/gcc-4.8.0/gcc/system.h:641:17: fatal error: gmp.h: No such
file or directory
 #include <gmp.h>
                 ^
compilation terminated.
configure:10359: $? = 1
configure: failed program was:


so the checks for strstr and strsignal are too strict.

How about more like:

const char* a = strsignal(1);

on the matter of conflicting declarations:
conftest.c:77:6: warning: conflicting types for built-in function 'ldexp'
[enabled by default]
 char ldexp ();


 conftest.c:109:6: warning: conflicting types for built-in function
'fprintf_unlocked' [enabled by defau
lt]
 char fprintf_unlocked ();
      ^
Undefined                       first referenced
 symbol                             in file
fprintf_unlocked                    /home/jkrell/tmp/cc2gUNar.o
ld: fatal: symbol referencing errors. No output written to conftest


conftest.c:109:6: warning: conflicting types for built-in function
'fputc_unlocked' [enabled by default
]
 char fputc_unlocked ();
      ^
Undefined                       first referenced
 symbol                             in file
fputc_unlocked                      /home/jkrell/tmp/ccenrM6Q.o

more for *_unlocked, fork but I guess all that is ok..

I'm confused about strstr.
strsignal is definitely a problem, due to const mismatch on the return type.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug bootstrap/56703] problems with strsignal and maybe strstr due to varying const on return type
  2013-03-23 23:06 [Bug bootstrap/56703] New: problems with strsignal and maybe strstr due to varying const on return type jay.krell at cornell dot edu
@ 2013-03-23 23:12 ` jay.krell at cornell dot edu
  2013-03-23 23:18 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jay.krell at cornell dot edu @ 2013-03-23 23:12 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56703

--- Comment #1 from Jay <jay.krell at cornell dot edu> 2013-03-23 23:12:03 UTC ---
I see that the check for any function involves a cast of its type -- i.e. it
isn't customized per-function, so a change isn't trivial.

For now I have removed strstr and strsignal from system.h -- assume they are
declared.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug bootstrap/56703] problems with strsignal and maybe strstr due to varying const on return type
  2013-03-23 23:06 [Bug bootstrap/56703] New: problems with strsignal and maybe strstr due to varying const on return type jay.krell at cornell dot edu
  2013-03-23 23:12 ` [Bug bootstrap/56703] " jay.krell at cornell dot edu
@ 2013-03-23 23:18 ` pinskia at gcc dot gnu.org
  2013-03-23 23:25 ` jay.krell at cornell dot edu
  2013-11-15 14:02 ` yves.caniou@ens-lyon.fr
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-03-23 23:18 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56703

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-03-23 23:18:09 UTC ---
What options did you use to configure GCC?  Also are you building gmp/mpfr in
the same tree?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug bootstrap/56703] problems with strsignal and maybe strstr due to varying const on return type
  2013-03-23 23:06 [Bug bootstrap/56703] New: problems with strsignal and maybe strstr due to varying const on return type jay.krell at cornell dot edu
  2013-03-23 23:12 ` [Bug bootstrap/56703] " jay.krell at cornell dot edu
  2013-03-23 23:18 ` pinskia at gcc dot gnu.org
@ 2013-03-23 23:25 ` jay.krell at cornell dot edu
  2013-11-15 14:02 ` yves.caniou@ens-lyon.fr
  3 siblings, 0 replies; 5+ messages in thread
From: jay.krell at cornell dot edu @ 2013-03-23 23:25 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56703

--- Comment #3 from Jay <jay.krell at cornell dot edu> 2013-03-23 23:24:55 UTC ---
gmp/mpfr/mpc are in-tree
Notice that it has gotten past the first stage..so I didn't bother double
checking what my bootstrap compiler was..though gcc/g++ 3.x is in $PATH.

Very simple configure line -- just setting -prefix.

jkrell@unstable10s [unstable10s]:~/obj/gcc480-sparc-sun-solaris2.10/gcc > head
../config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.64.  Invocation command line was

  $ /home/jkrell/src/gcc-4.8.0/configure
-prefix=/home/jkrell/gcc480-sparc-sun-solaris2.10


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug bootstrap/56703] problems with strsignal and maybe strstr due to varying const on return type
  2013-03-23 23:06 [Bug bootstrap/56703] New: problems with strsignal and maybe strstr due to varying const on return type jay.krell at cornell dot edu
                   ` (2 preceding siblings ...)
  2013-03-23 23:25 ` jay.krell at cornell dot edu
@ 2013-11-15 14:02 ` yves.caniou@ens-lyon.fr
  3 siblings, 0 replies; 5+ messages in thread
From: yves.caniou@ens-lyon.fr @ 2013-11-15 14:02 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 7110 bytes --]

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56703

Yves Caniou <yves.caniou@ens-lyon.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yves.caniou@ens-lyon.fr

--- Comment #4 from Yves Caniou <yves.caniou@ens-lyon.fr> ---
I have the same issue with gcc-4.8.2 compiling gcc-4.8.2, on a Intel(R) Xeon(R)
CPU E5-2630 0 @ 2.30GHz.

First, compiling 4.8.2 from 4.7.2 (debian): no problem.
I use gmp-5.1.3, mpfr-3.1.2, mpc-1.0.1. There are not intree.
Once compiled, their respective prefix/lib are added to LD_LIBRARY_PATH.
Gcc source is copied local disk, so no NFS or such.
I call:
/tmp/YC/gcc/src-4.8.2/configure --host=x86_64-linux-gnu
--build=x86_64-linux-gnu --prefix=/home/ycaniou/bin/amd64/4.7.2/gcc
--disable-altivec --disable-fixed-point --without-cloog --without-ppl
--disable-lto --enable-nls --without-included-gettext --with-system-zlib
--enable-obsolete --disable-werror --enable-secureplt --disable-multilib
--enable-libmudflap --disable-libssp --enable-libgomp --enable-checking=release
--disable-libgcj --enable-libstdcxx-time --enable-languages=c,c++,fortran
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-targets=all
--with-gmp=/home/ycaniou/bin/amd64/4.7.2/gmp
--with-mpfr=/home/ycaniou/bin/amd64/4.7.2/mpfr
--with-mpc=/home/ycaniou/bin/amd64/4.7.2/mpc
Everything executes well after a "make -j 8", and "make install" does its job.

Compiling 4.8.2 with the new installed 4.8.2:
. First, environment variables are updated:
library path with 4.7.2_gcc-4.8.2_prefix/lib64
CPLUS include path with 4.7.2_gcc-4.8.2_prefix/include (I also tried with in
addition include/c++/4.8.2, with same errors...)
binary path with 4.7.2_gcc-4.8.2_prefix/bin
. gmp-5.1.3, mpfr-3.1.2, mpc-1.0.1, not intree, are compiled with the
4.7.2_gcc-4.8.2 without any problem. And same steps are made: their respective
4.8.2_prefix/lib are added to LD_LIBRARY_PATH. GCC source on local disk.
I call:
/tmp/YC/gcc/src-4.8.2/configure --host=x86_64-linux-gnu
--build=x86_64-linux-gnu --prefix=/home/ycaniou/bin/amd64/4.8.2/gcc
--disable-altivec --disable-fixed-point --without-cloog --without-ppl
--disable-lto --enable-nls --without-included-gettext --with-system-zlib
--enable-obsolete --disable-werror --enable-secureplt --disable-multilib
--enable-libmudflap --disable-libssp --enable-libgomp --enable-checking=release
--disable-libgcj --enable-libstdcxx-time --enable-languages=c,c++,fortran
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-targets=all
--with-gmp=/home/ycaniou/bin/amd64/4.8.2/gmp
--with-mpfr=/home/ycaniou/bin/amd64/4.8.2/mpfr
--with-mpc=/home/ycaniou/bin/amd64/4.8.2/mpc

And got the errors:
x86_64-linux-gnu-g++ -c  -DGENERATOR_FILE -g -DIN_GCC   -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I.
-I/tmp/YC/gcc/src-4.8.2/gcc -I/tmp/YC/gcc/src-4.8.2/gcc/.
-I/tmp/YC/gcc/src-4.8.2/gcc/../include
-I/tmp/YC/gcc/src-4.8.2/gcc/../libcpp/include
-I/home/ycaniou/bin/amd64/4.8.2/gmp/include
-I/home/ycaniou/bin/amd64/4.8.2/mpfr/include
-I/home/ycaniou/bin/amd64/4.8.2/mpc/include 
-I/tmp/YC/gcc/src-4.8.2/gcc/../libdecnumber
-I/tmp/YC/gcc/src-4.8.2/gcc/../libdecnumber/bid -I../libdecnumber
-I/tmp/YC/gcc/src-4.8.2/gcc/../libbacktrace   
/tmp/YC/gcc/src-4.8.2/gcc/gengtype.c -o gengtype.o
In file included from /tmp/YC/gcc/src-4.8.2/gcc/gcc-ar.c:22:0:
/tmp/YC/gcc/src-4.8.2/gcc/system.h:500:34: error: declaration of C function
‘const char* strsignal(int)’ conflicts with
 extern const char *strsignal (int);
                                  ^
In file included from
/home/ycaniou/bin/amd64/4.7.2/gcc-4.8.2_install/include/c++/4.8.2/cstring:42:0,
                 from /tmp/YC/gcc/src-4.8.2/gcc/system.h:205,
                 from /tmp/YC/gcc/src-4.8.2/gcc/gcc-ar.c:22:
/usr/include/string.h:566:14: error: previous declaration ‘char*
strsignal(int)’ here
 extern char *strsignal (int __sig) __THROW;
              ^
In file included from /tmp/YC/gcc/src-4.8.2/gcc/system.h:645:0,
                 from /tmp/YC/gcc/src-4.8.2/gcc/gcc-ar.c:22:
/tmp/YC/gcc/src-4.8.2/gcc/../include/libiberty.h:110:36: error: new declaration
‘char* basename(const char*)’
 extern char *basename (const char *);
                                    ^
In file included from
/home/ycaniou/bin/amd64/4.7.2/gcc-4.8.2_install/include/c++/4.8.2/cstring:42:0,
                 from /tmp/YC/gcc/src-4.8.2/gcc/system.h:205,
                 from /tmp/YC/gcc/src-4.8.2/gcc/gcc-ar.c:22:
/usr/include/string.h:603:28: error: ambiguates old declaration ‘const char*
basename(const char*)’
 extern "C++" __const char *basename (__const char *__filename)
>From gcc-bugs-return-434696-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Nov 15 14:04:22 2013
Return-Path: <gcc-bugs-return-434696-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 26911 invoked by alias); 15 Nov 2013 14:04:22 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 26884 invoked by uid 48); 15 Nov 2013 14:04:19 -0000
From: "rglindley at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/59147] 128-bit division error
Date: Fri, 15 Nov 2013 14:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.6.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rglindley at gmail dot 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: attachments.created
Message-ID: <bug-59147-4-SVDK5hg7eO@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59147-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59147-4@http.gcc.gnu.org/bugzilla/>
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: 2013-11/txt/msg01473.txt.bz2
Content-length: 299

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY147

--- Comment #1 from rglindley at gmail dot com ---
Created attachment 31227
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id1227&actioníit
compiler information

Output from following:
gfortran -v -save-temps -Wall -Wextra division_test.f90


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-15 14:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-23 23:06 [Bug bootstrap/56703] New: problems with strsignal and maybe strstr due to varying const on return type jay.krell at cornell dot edu
2013-03-23 23:12 ` [Bug bootstrap/56703] " jay.krell at cornell dot edu
2013-03-23 23:18 ` pinskia at gcc dot gnu.org
2013-03-23 23:25 ` jay.krell at cornell dot edu
2013-11-15 14:02 ` yves.caniou@ens-lyon.fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).