public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/24727]  New: type "const void *" produces a warning when promoting to "void *"
@ 2005-11-07 23:37 joshudson at gmail dot com
  2005-11-08  0:07 ` [Bug c/24727] " schwab at suse dot de
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: joshudson at gmail dot com @ 2005-11-07 23:37 UTC (permalink / raw)
  To: gcc-bugs

Tried this on two machines:

SunOS hornet 5.10 Generic sun4u sparc SUNW,Ultra-4
    with GCC 4.0.1
Linux numenor 2.6.13 #9 Mon Sep 19 19:03:35 PDT 2005 i686 unknown unknown
GNU/Linux
    with GCC 3.3.6

The following code produces spurios warning:
/* Cut here */
int x_read(int h, void *buf, unsigned len);
int x_write(int h, const void *buf, unsigned len);

typedef int (*x_io)(int h, void *buf, unsigned len);
int blockio(int h, long long offset, void *buf, x_io action);

int bug(int h, unsigned where, void *buf)
{
        return blockio(h, (long long)where << 10, buf, x_write);
}
/* Cut here */
sample.c: In function `bug':
sample.c:9: warning: passing arg 4 of `blockio' from incompatible pointer type


-- 
           Summary: type "const void *" produces a warning when promoting to
                    "void *"
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: joshudson at gmail dot com
  GCC host triplet: Multiple


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


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

end of thread, other threads:[~2005-12-07 17:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-07 23:37 [Bug c/24727] New: type "const void *" produces a warning when promoting to "void *" joshudson at gmail dot com
2005-11-08  0:07 ` [Bug c/24727] " schwab at suse dot de
2005-11-08  4:25 ` joshudson at gmail dot com
2005-11-08  4:34 ` pinskia at gcc dot gnu dot org
2005-12-07 17:08 ` pinskia at gcc dot gnu dot org
2005-12-07 17:09 ` pinskia at gcc dot gnu dot 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).