public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/16378] New: incorrect warning "with different width" with -O2 -Wconversion
@ 2004-07-06  5:07 pepster at users dot sourceforge dot net
  2004-07-06  7:11 ` [Bug c/16378] " pinskia at gcc dot gnu dot org
  2004-07-06  7:35 ` pepster at users dot sourceforge dot net
  0 siblings, 2 replies; 3+ messages in thread
From: pepster at users dot sourceforge dot net @ 2004-07-06  5:07 UTC (permalink / raw)
  To: gcc-bugs

C code (relevant part from from include/glib-2.0/glib/gstring.h)
---------------------------------------------------------------------------
typedef unsigned char gchar;
typedef int gsize;
typedef int gssize;

typedef struct _GString		GString;


struct _GString
{
  gchar  *str;
  gsize len;    
  gsize allocated_len;
};

GString*     g_string_insert_c          (GString	 *string,
					 gssize		  pos,    
					 gchar		  c);

static inline GString*
g_string_append_c_inline (GString *gstring,
                          gchar    c)
{
  g_string_insert_c(gstring, -1, c);
  return gstring;
}
----------------------------------------------------------


gcc -v  -c -O2  -Wconversion   cc.c
Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/specs
Configured with: ../gcc-3.4.1/configure --enable-languages=c,c++
Thread model: posix
gcc version 3.4.1
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.1/cc1 -quiet -v cc.c -quiet
-dumpbase cc.c -mtune=pentiumpro -auxbase cc -O2 -Wconversion -version -o
/tmp/ccKwK1vr.s
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory
"/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/include
 /usr/include
End of search list.
GNU C version 3.4.1 (i686-pc-linux-gnu)
	compiled by GNU C version 3.4.1.
GGC heuristics: --param ggc-min-expand=80 --param ggc-min-heapsize=94545
cc.c: In function `g_string_append_c_inline':
cc.c:22: warning: passing arg 3 of `g_string_insert_c' with different width due
to prototype
 as -V -Qy -o cc.o /tmp/ccKwK1vr.s
GNU assembler version 2.13.90.0.2 (i386-redhat-linux) using BFD version
2.13.90.0.2 20020802

uname -a
Linux yoda 2.4.20-30.8.legacy #1 Fri Feb 20 18:58:10 PST 2004 i686 athlon i386
GNU/Linux

-- 
           Summary: incorrect warning "with different width" with -O2 -
                    Wconversion
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pepster at users dot sourceforge dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c/16378] incorrect warning "with different width" with -O2 -Wconversion
  2004-07-06  5:07 [Bug c/16378] New: incorrect warning "with different width" with -O2 -Wconversion pepster at users dot sourceforge dot net
@ 2004-07-06  7:11 ` pinskia at gcc dot gnu dot org
  2004-07-06  7:35 ` pepster at users dot sourceforge dot net
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-06  7:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-06 07:11 -------
This is a dup of bug 6614, the issue comes down to pre-ANSI C and where prototypes did not exist at 
all.

*** This bug has been marked as a duplicate of 6614 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug c/16378] incorrect warning "with different width" with -O2 -Wconversion
  2004-07-06  5:07 [Bug c/16378] New: incorrect warning "with different width" with -O2 -Wconversion pepster at users dot sourceforge dot net
  2004-07-06  7:11 ` [Bug c/16378] " pinskia at gcc dot gnu dot org
@ 2004-07-06  7:35 ` pepster at users dot sourceforge dot net
  1 sibling, 0 replies; 3+ messages in thread
From: pepster at users dot sourceforge dot net @ 2004-07-06  7:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pepster at users dot sourceforge dot net  2004-07-06 07:35 -------
Since this bug was opened in 2002 I guess there is little chance of a fix. 
I would like to keep using -Wconversion, so can anyone provide a workaround?
What do I need to cast and to what?

Remember this is in the glib library ...


Joseph


-- 


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


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

end of thread, other threads:[~2004-07-06  7:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-06  5:07 [Bug c/16378] New: incorrect warning "with different width" with -O2 -Wconversion pepster at users dot sourceforge dot net
2004-07-06  7:11 ` [Bug c/16378] " pinskia at gcc dot gnu dot org
2004-07-06  7:35 ` pepster at users dot sourceforge dot net

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