public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/1750: suprrious warning when using memset
@ 2001-04-01  0:00 jdeifik
  0 siblings, 0 replies; only message in thread
From: jdeifik @ 2001-04-01  0:00 UTC (permalink / raw)
  To: gcc-gnats

>Number:         1750
>Category:       c
>Synopsis:       suprrious warning when using memset
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 23 14:26:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     jeff deifik
>Release:        gcc version 2.95.2 19991024
>Organization:
>Environment:
redhat linux 6.2
>Description:
/* repeat by:
   gcc -c -g -O  -Wpointer-arith  gcc-bug-memset.c */
/* gcc -v says:
Reading specs from /home/jdeifik/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release) */


#include <string.h>

void foo(void) 
{
    char a[10], b[10];
    
    memset(a, 3, 1);
}


generates:
In file included from /usr/include/string.h:346,
                 from gcc-bug-memset.c:8:
/usr/include/bits/string2.h: In function `__strcpy_small':
/usr/include/bits/string2.h:419: warning: pointer of type `void *' used in arithmetic
/usr/include/bits/string2.h:427: warning: pointer of type `void *' used in arithmetic
/usr/include/bits/string2.h:432: warning: pointer of type `void *' used in arithmetic
/usr/include/bits/string2.h:437: warning: pointer of type `void *' used in arithmetic
/usr/include/bits/string2.h:439: warning: pointer of type `void *' used in arithmetic
/usr/include/bits/string2.h:444: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c: In function `foo':
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
gcc-bug-memset.c:14: warning: pointer of type `void *' used in arithmetic
>How-To-Repeat:
gcc -c -g -O  -Wpointer-arith  gcc-bug-memset.c
>Fix:
unknown
>Release-Note:
>Audit-Trail:
>Unformatted:
>From joerg_brunsmann@yahoo.de Sun Apr 01 01:46:00 2001
From: joerg_brunsmann@yahoo.de
To: gcc-gnats@gcc.gnu.org
Subject: java/2449: PrintStream defines 'out' as BufferedOutputStream
Date: Sun, 01 Apr 2001 01:46:00 -0000
Message-id: <20010401093839.24446.qmail@sourceware.cygnus.com>
X-SW-Source: 2001-q2/msg00000.html
Content-length: 1386

>Number:         2449
>Category:       java
>Synopsis:       PrintStream defines 'out' as BufferedOutputStream
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 01 01:46:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     joerg_brunsmann@yahoo.de
>Release:        unknown-1.0
>Organization:
>Environment:
gcc 3.0
>Description:
While trying to compile the kaffe rmi classes
I found this:
 
The rmi implementation defines a class called
LogStream which extends PrintStream:
 
import java.io.*;
 
public class LogStream
        extends PrintStream {
 
private LogStream(OutputStream s) {
  super(s);
}
 
public void setOutputStream(OutputStream s) {
        out = s;
}
 
}
 
$ gcj LogStream.java
 
gives:
 
LogStream.java: In class `LogStream':
LogStream.java: In method `LogStream.setOutputStream(java.io.OutputStream)':
LogStream.java:13: Incompatible type for `='. Explicit cast needed to convert `java.io.OutputStream' to `java.io.BufferedOutputStream'.
        out = s;
               ^
1 error
 
This is a correct error message because the libjava
PrintStream class defines 'out' as BufferedOutputStream.
Is the suggestion correct to remove the out from PrintStream?  
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-01  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-01  0:00 c/1750: suprrious warning when using memset jdeifik

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