🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9281

Re: need help with a delcaration

#9281
From: karl
Date: Tue, 09 Sep 1986 18:00
16 lines
1227 bytes
BJORNDAS%CLARGRA@WISCVM.WISC.EDU (Sterling Bjorndahl) writes:
>foo(ch)
>char ch;  /* Or should this be "int ch;" because it gets promoted? */
>{}
>
>On my micro it MUST be declared an int; I think this is screwy...

This relates to what I just said in another topic.  Discounting function
prototyping (ANSI proposed), actual arguments of type char, short, float,
and array are converted; therefore one should never declare formal arguments
of these types.  However, you are right -- the C language is supposed to
silently fix it for you by interpreting your "char" declaration as an "int".
Your compiler is broken.

Karl W. Z. Heuer (ima!haddock!karl; karl@haddock.isc.com), The Walking Lint
Technical Details
Message-ID: <86900051@haddock>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!think!ima!haddock!karl
References: <3594@brl-smoke.ARPA>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!think!ima!haddock!karl
From: karl@haddock
Newsgroups: net.lang.c
Subject: Re: need help with a delcaration
Message-ID: <86900051@haddock>
Date: Tue, 9-Sep-86 14:00:00 EDT
Article-I.D.: haddock.86900051
Posted: Tue Sep  9 14:00:00 1986
Date-Received: Tue, 9-Sep-86 21:18:25 EDT
References: <3594@brl-smoke.ARPA>
Lines: 16
Nf-ID: #R:brl-smoke.ARPA:3594:haddock:86900051:000:692
Nf-From: haddock!karl    Sep  9 14:00:00 1986