[Asterisk-Dev] Re: asterisk/include/asterisk utils.h,1.46,1.47

Kevin P. Fleming kpfleming at digium.com
Sun Oct 30 11:40:32 MST 2005


Luigi Rizzo wrote:

> i am saying a different thing. If you pass an argument by value,
> almost always the compiler passes it as a native integer type,
> because of alignment issues of surrounding arguments.
> This in turn results in an implicit cast (which you cannot avoid),
> which is often flagged by -Wimplicit-cast and this prevents from
> running with -Werror.

OK, I understand your point now.

However, in this case since the range of the argument is explicitly the 
size of a 'short' and users of the API call should be made fully aware 
of that, I'm hesitant to some other argument type.

I'm a little confused why an internal compiler optimization 
(platform-based) would cause an 'implicit cast' as defined by this 
warning option... I would think that option to be intended to find cases 
where the programmer accidentally neglected to explicitly cast a value 
(or use the proper variable types).



More information about the asterisk-dev mailing list