help-zile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [zile-devel] 2.2.1: excessive compiler warning flags


From: Christian Weisgerber
Subject: Re: [zile-devel] 2.2.1: excessive compiler warning flags
Date: Thu, 21 Jul 2005 17:35:34 +0200
User-agent: Mutt/1.4.2.1i

Reuben Thomas:

> >cc -c -I../doc -I.. -I../src -O2 -pipe -Wall -W -Wmissing-prototypes 
> >-Wstrict-prototypes -Wconversion -pedantic ./mkdoc.c
> >In file included from mkdoc.c:18:
> >../src/vasprintf.c: In function `type_s':
> >../src/vasprintf.c:205: warning: passing arg 2 of `print_it' with 
> >different width due to prototype
> 
> Can you try casting one of the constants to size_t and telling me 
> whether this fixes it or not, and also the version of gcc you're using?

Yes, it does.  gcc 3.3.5.

> If casting fixes the problem, I'm happy to put all the relevant casts in 
> (or perhaps better, use constants of the correct length). If not, I'm 
> inclined to see whether gcc 4 fixes the problem, because so far I have 
> benefitted enormously from all the warning settings and I am loth to 
> turn them off.

I don't think there is a portable constant length corresponding to
"size_t".  I also think the warnings emitted by -Wconversion are
excessive.  Something like this

  void func(size_t s);

  ...
  func(1);
  ...

will trigger

  warning: passing arg 1 of `func' with different width due to prototype

This is not helpful.  It doesn't point to any actual problem.

Now, if you want to investigate warnings, there are a number of
very scary

  warning: cast to pointer from integer of different size
  warning: cast from pointer to integer of different size

in regex.c.

-- 
Christian "naddy" Weisgerber                          address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]