public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/47972] New: error.c:158:7: warning: return makes pointer from integer without a cast
@ 2011-03-03 14:42 danglin at gcc dot gnu.org
  2011-03-03 16:00 ` [Bug libfortran/47972] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-03-03 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: error.c:158:7: warning: return makes pointer from
                    integer without a cast
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: danglin@gcc.gnu.org
              Host: hppa1.1-hp-hpux10*
            Target: hppa1.1-hp-hpux10*
             Build: hppa1.1-hp-hpux10*


libtool: compile:  /xxx/gnu/gcc/objdir/./gcc/xgcc -B/xxx/gnu/gcc/objdir/./gcc/
-
B/opt/gnu/gcc/gcc-4.6/hppa1.1-hp-hpux10.20/bin/
-B/opt/gnu/gcc/gcc-4.6/hppa1.1-h
p-hpux10.20/lib/ -isystem /opt/gnu/gcc/gcc-4.6/hppa1.1-hp-hpux10.20/include
-isy
stem /opt/gnu/gcc/gcc-4.6/hppa1.1-hp-hpux10.20/sys-include -DHAVE_CONFIG_H -I.
-
I../../../../gcc/libgfortran -iquote../../../../gcc/libgfortran/io
-I../../../..
/gcc/libgfortran/../gcc -I../../../../gcc/libgfortran/../gcc/config
-I../../../.
./gcc/libgfortran/../libquadmath -I../../.././gcc -D_GNU_SOURCE -std=gnu99
-Wall
 -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra
-Wwrite
-strings -fcx-fortran-rules -g -O2 -threads -MT error.lo -MD -MP -MF
.deps/error
.Tpo -c ../../../../gcc/libgfortran/runtime/error.c  -fPIC -DPIC -o
.libs/error.
o
../../../../gcc/libgfortran/runtime/error.c: In function 'gf_strerror':
../../../../gcc/libgfortran/runtime/error.c:158:7: warning: return makes
pointer from integer without a cast [enabled by default]

Proto:
int strerror_r(int errnum, char *buffer, int buflen);

Declaration is in string.h.


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

* [Bug libfortran/47972] error.c:158:7: warning: return makes pointer from integer without a cast
  2011-03-03 14:42 [Bug libfortran/47972] New: error.c:158:7: warning: return makes pointer from integer without a cast danglin at gcc dot gnu.org
@ 2011-03-03 16:00 ` rguenth at gcc dot gnu.org
  2011-03-03 17:58 ` jb at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-03 16:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-03 15:59:49 UTC ---
*** Bug 47973 has been marked as a duplicate of this bug. ***


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

* [Bug libfortran/47972] error.c:158:7: warning: return makes pointer from integer without a cast
  2011-03-03 14:42 [Bug libfortran/47972] New: error.c:158:7: warning: return makes pointer from integer without a cast danglin at gcc dot gnu.org
  2011-03-03 16:00 ` [Bug libfortran/47972] " rguenth at gcc dot gnu.org
@ 2011-03-03 17:58 ` jb at gcc dot gnu.org
  2011-03-03 18:12 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jb at gcc dot gnu.org @ 2011-03-03 17:58 UTC (permalink / raw)
  To: gcc-bugs

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

Janne Blomqvist <jb at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2011.03.03 17:58:32
                 CC|                            |jb at gcc dot gnu.org
     Ever Confirmed|0                           |1
           Severity|normal                      |trivial

--- Comment #2 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-03-03 17:58:32 UTC ---
>From the code, with line numbers:


 153   /* TODO: How to prevent the compiler warning due to strerror_r of

 154      the untaken branch having the wrong return type?  */

 155   if (__builtin_classify_type (strerror_r (0, buf, 0)) == 5)

 156     {

 157       /* GNU strerror_r()  */

 158       return strerror_r (errnum, buf, buflen);

 159     }

 160   else

 161     {

 162       /* POSIX strerror_r ()  */

 163       strerror_r (errnum, buf, buflen);

 164       return buf;

 165     }


That is, this warning is not an indication of a real problem, as the "wrong"
branch is never taken. Unless somebody has a clever idea how to silence the
compiler warning, I'm planning on closing as WONTFIX.


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

* [Bug libfortran/47972] error.c:158:7: warning: return makes pointer from integer without a cast
  2011-03-03 14:42 [Bug libfortran/47972] New: error.c:158:7: warning: return makes pointer from integer without a cast danglin at gcc dot gnu.org
  2011-03-03 16:00 ` [Bug libfortran/47972] " rguenth at gcc dot gnu.org
  2011-03-03 17:58 ` jb at gcc dot gnu.org
@ 2011-03-03 18:12 ` jakub at gcc dot gnu.org
  2011-11-07 22:57 ` fxcoudert at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-03 18:12 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-03 18:11:40 UTC ---
Try:
  return
    __builtin_choose_expr (__builtin_classify_type (strerror_r (0, buf, 0))
                           == 5,
                           /* GNU strerror_r()  */
                           strerror_r (errnum, buf, buflen),
                           /* POSIX strerror_r ()  */
                           (strerror_r (errnum, buf, buflen), buf));
?


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

* [Bug libfortran/47972] error.c:158:7: warning: return makes pointer from integer without a cast
  2011-03-03 14:42 [Bug libfortran/47972] New: error.c:158:7: warning: return makes pointer from integer without a cast danglin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-03-03 18:12 ` jakub at gcc dot gnu.org
@ 2011-11-07 22:57 ` fxcoudert at gcc dot gnu.org
  2011-11-08 22:00 ` fxcoudert at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2011-11-07 22:57 UTC (permalink / raw)
  To: gcc-bugs

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

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
             Status|WAITING                     |NEW
                 CC|                            |fxcoudert at gcc dot
                   |                            |gnu.org


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

* [Bug libfortran/47972] error.c:158:7: warning: return makes pointer from integer without a cast
  2011-03-03 14:42 [Bug libfortran/47972] New: error.c:158:7: warning: return makes pointer from integer without a cast danglin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-11-07 22:57 ` fxcoudert at gcc dot gnu.org
@ 2011-11-08 22:00 ` fxcoudert at gcc dot gnu.org
  2011-11-08 22:03 ` fxcoudert at gcc dot gnu.org
  2011-11-09 18:18 ` rth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2011-11-08 22:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> 2011-11-08 21:58:51 UTC ---
Author: fxcoudert
Date: Tue Nov  8 21:58:47 2011
New Revision: 181180

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181180
Log:
    PR libfortran/47972
    * runtime/error.c (gf_strerror): Silence warning.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/runtime/error.c


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

* [Bug libfortran/47972] error.c:158:7: warning: return makes pointer from integer without a cast
  2011-03-03 14:42 [Bug libfortran/47972] New: error.c:158:7: warning: return makes pointer from integer without a cast danglin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-11-08 22:00 ` fxcoudert at gcc dot gnu.org
@ 2011-11-08 22:03 ` fxcoudert at gcc dot gnu.org
  2011-11-09 18:18 ` rth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2011-11-08 22:03 UTC (permalink / raw)
  To: gcc-bugs

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

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #5 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> 2011-11-08 22:00:08 UTC ---
Fixed on trunk, thanks Jakub for the patch!


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

* [Bug libfortran/47972] error.c:158:7: warning: return makes pointer from integer without a cast
  2011-03-03 14:42 [Bug libfortran/47972] New: error.c:158:7: warning: return makes pointer from integer without a cast danglin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-11-08 22:03 ` fxcoudert at gcc dot gnu.org
@ 2011-11-09 18:18 ` rth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rth at gcc dot gnu.org @ 2011-11-09 18:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Henderson <rth at gcc dot gnu.org> 2011-11-09 18:09:45 UTC ---
Author: rth
Date: Wed Nov  9 18:09:42 2011
New Revision: 181223

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181223
Log:
    PR libfortran/47972
    * runtime/error.c (gf_strerror): Silence warning.

Modified:
    trunk/libgfortran/ChangeLog


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

end of thread, other threads:[~2011-11-09 18:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-03 14:42 [Bug libfortran/47972] New: error.c:158:7: warning: return makes pointer from integer without a cast danglin at gcc dot gnu.org
2011-03-03 16:00 ` [Bug libfortran/47972] " rguenth at gcc dot gnu.org
2011-03-03 17:58 ` jb at gcc dot gnu.org
2011-03-03 18:12 ` jakub at gcc dot gnu.org
2011-11-07 22:57 ` fxcoudert at gcc dot gnu.org
2011-11-08 22:00 ` fxcoudert at gcc dot gnu.org
2011-11-08 22:03 ` fxcoudert at gcc dot gnu.org
2011-11-09 18:18 ` rth at gcc dot gnu.org

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).