Subject: Re: compile mystery
To: Antti Kantee <pooka@iki.fi>
From: None <seebs@plethora.net>
List: netbsd-help
Date: 07/25/1999 20:43:31
In message <19990726021310.B9256@babylon5.kolster.fi>, Antti Kantee writes:
>I am wondering why this happens with the following code:
>#include <stdlib.h>
>void nada   __P((char));
>void
>nada(siuh) char siuh; {}

>babylon5:11:~/src/omat> cc -Wall -ansi -pedantic -c mystery.c
>mystery.c: In function `nada':
>mystery.c:4: warning: promoted argument `siuh' doesn't match prototype
>mystery.c:2: warning: prototype declaration

Yup!

>If ``siuh'' is an int the code compiles fine. If I write void nada(char
>siuh) the code compiles fine. Can anyone shed some light?

void nada(siuh) char siuh;
declares 'siuh' as being of type int.

In pre-ANSI declarations, everything is subject to "the normal promotions".

-s