[patch] clears -Wall warnings

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Thu May 22 12:55:51 PDT 2008


On Mon, 19 May 2008, Denys Vlasenko wrote:

> Type casts are brute-force way to shut up the compiler.

I agree with you, but what's to be done if types are (for various reasons)
not compatible, which is the case with the current source?

> If subsequent code changes will turn this into an actual error
> (imagine that scr_width is a *function name* after a code edit),
> code without type cast would not compile, whereas code with one
> will.

I agree with that too but, as I see it, it's also a way to document
unconformity.

> IOW: type casts remove all benefits you have from using a strongly
> typed language.

Yes.

> > Are we interested in the -Wconversion compiler option?  It warns about
> > things like this:
> >
> >   archival/libunarchive/get_header_tar.c:300: warning: conversion to
> >   'size_t' from 'off_t' may alter its value
> >
> > and this:
> >
> >   include/xatonum.h: In function 'xatou32':
> >   include/xatonum.h:109: warning: conversion to 'uint32_t' from 'int' may
> >   change the sign of the result
>
> Both seem to be false positives.

Alright.

Attached is a full list of such warnings (not latest svn).  Are all those
false positives too?


Cheers,

-- 
Cristian


More information about the busybox mailing list