home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!kronos.arc.nasa.gov!joshr
- From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
- Subject: Re: Why won't this compile under Think C 5.0?
- Message-ID: <1992Aug26.221238.6018@kronos.arc.nasa.gov>
- Sender: usenet@kronos.arc.nasa.gov (Will Edgington, wedgingt@ptolemy.arc.nasa.gov)
- Nntp-Posting-Host: kronos-arclan.arc.nasa.gov
- Organization: NASA/ARC Information Sciences Division
- References: <T5L3PB3w164w@uuisis.isis.org>
- Date: Wed, 26 Aug 1992 22:12:38 GMT
- Lines: 43
-
- In article <T5L3PB3w164w@uuisis.isis.org> rrwood@uuisis.isis.org (Roy Wood) writes:
- >Okay, I'm feeling frustrated and dumb. Look at this:
- >
- >/* ----------------------------------------------------- */
- >
- >extern void MyFunction(char);
- >
- >void MyFunction(theChar)
- >char theChar;
- >{
- > /* do stuff */
- >}
- >
- >/* ---------------------------------------------------- */
- >
- >Actually, the function prototype is getting pulled in from a #include file,
- >and the "extern" doesn't really matter much (i.e. it still doesn't work even
- >if I leave it out). The problem seems to center around the use of the
- >"char" data type-- it works with int's, long's, mother's-maiden-names, etc.,
- >but not for char's.
- >
- >So, what gives?
- >
- >-Roy
-
- Try using inline - definitions (is that what they're called?)
- like so:
- void MyFunction(char theChar)
- {
- /* do stufff */
- }
-
- possibly the char you pass is being promoted to an int, or some such.
- Also, use strict prototype checking (require).
- I assume you are using thinkC.
-
-
-
- --
- ----------------------------------
- #include <std/disclaimer.h> Josh Rabinowitz, Mac TCL programmer
- joshr@kronos.arc.nasa.gov
- "Send a salami to your boy in the army" - Katz's delicatessen, NYC
-