home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!network.ucsd.edu!qualcom.qualcomm.com!qualcom.qualcomm.com!sdorner
- From: sdorner@qualcom.qualcomm.com (Steve Dorner)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Why won't this compile under Think C 5.0?
- Message-ID: <1992Aug27.173756.13638@qualcomm.com>
- Date: 27 Aug 92 17:37:56 GMT
- References: <T5L3PB3w164w@uuisis.isis.org>
- Sender: news@qualcomm.com
- Organization: Qualcomm, Inc., San Diego, CA
- Lines: 29
- Nntp-Posting-Host: qualcom.qualcomm.com
-
- rrwood@uuisis.isis.org (Roy Wood) writes:
- >extern void MyFunction(char);
-
- This prototype indicates that only a single byte will be pushed on the
- stack for the char (in theory; I don't think that can really be done,
- can it?).
-
- >void MyFunction(theChar)
- >char theChar;
- >{
-
- This is an old-style declaration, which implies promotion from char to
- int. It is the same as writing:
-
- void MyFunction(theChar)
- int theChar;
- {
-
- Thus, you have incompatible declarations.
-
- Old-style declarations are assumed to use promotion for compatibility
- reasons. Otherwise, compiling your code with an ANSI-aware compiler
- would suddenly change the code's behavior, which some people feel is
- A Bad Thing. (Thank god I can write "short i=-1;" now, though.)
-
- None of this is specific to THINK C; it's SOP for a C compiler.
- --
- Steve Dorner, Qualcomm, Inc.
- Yes, I'm still working on Eudora and it's still free.
-