Subject: toolchain/27068: gcc -Wconversion will give an error on short types specified in non K&R format
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <cliff@snipe444.org>
List: netbsd-bugs
Date: 09/28/2004 19:34:17
>Number: 27068
>Category: toolchain
>Synopsis: gcc -Wconversion will give an error on short types specified in non K&R format
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: toolchain-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Sep 28 19:35:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Cliff Wright
>Release: 1.6.1/2.0_BETA
>Organization:
>Environment:
>Description:
using either gcc 2.95.3 from NetBSD 1.6.1 or gcc 3.3.3 from NetBSD 2.0_BETA for i386 when the compiler is given the warining option -Wconversion a warning is issued ("warning: passing arg 1 of `some_function' with different width due to prototype") when an argument is typed as short using an ANSI format. If either K&R format is used, or another type such as int, or long is used, no warning is issued.
>How-To-Repeat:
use cc -Wconversion to compile the following
some_function(short x)
{
return (x);
}
int main()
{
short a_variable;
some_function(a_variable);
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: