ThinkC Moving code from version 5 to 6 then to 7

Relating to ThinkC Development

Eric's Edge

Tinkerer
Oct 31, 2021
122
87
28
I am attempting to work through the examples in Macintosh C Programming Primer Vol. 1 Second Edition by Dave Mark and Cartwright Reed using Think C 6.0.1. I'm running into some issues with the code. While looking for answers I ran across this article in MacTech by Dave Mark. Odds and Ends - Universal headers and code building under THINK & CodeWarrior for 68K and PowerPC.

We may need to consider updating the examples from this book to ensure they work for beginners or they may get frustrated trying to follow along. I really like how the examples are done and the explanation in this book and would like to continue using it. Unfortunately, there are no newer versions of the book.

http://preserve.mactech.com/articles/mactech/Vol.10/10.08/OddsandEnds/index.html

Seems like every time Symantec comes out with a new version of their C compiler, I end up having to make a bunch of changes to my source code.

In writing a book, that can be a real pain, since I have no way of getting the source code changes to the people who have already purchased the book and then upgrade their compiler. Bottom line, if you know someone who has a copy of the Primer, please pass this column along to them. Better yet, help support MacTech and tell them to get a subscription...

When I moved my code from THINK 5 to THINK 6, I ended up adding a bunch of typecasts to various Toolbox routines, casting the parameters so they matched the function prototypes in the Toolbox include files. Adding the typecasts was a pain, but it definitely made my code much better.

THINK 7 kept the strict type checking imposed by THINK 6. Much more importantly, THINK 7 replaced the THINK 6 Toolbox include files with Apple’s standardized universal headers.
 

eric

Administrator
Staff member
Sep 2, 2021
941
1,542
93
MN
scsi.blue
I'm going thorough this book on ThinkC 6.0.1 and I haven't run into any code that hasn't worked yet - do you have an example?

Edit:
I see the examples in the article now, It does remind me I MAXLONG didnt work but I just thought it was me. A good resource - and maybe should say "If you want to use Think 7 read this and you're a bit on your own" :)
 
Last edited:
  • Haha
Reactions: Cashed

pfuentes69

Active Tinkerer
Oct 27, 2021
380
293
63
Switzerland
I had similar issues when moving from Symantec C++ 6 to 7.
It seems that they didn't put much attention to make the TCL backwards compatible...

So for the sake of simplicity, for the study group people should stick initially to the same version, or funky things will happen... and frustration too...
 

Crutch

Tinkerer
Jul 10, 2022
293
228
43
Chicago
In general there are compiler settings in the project preferences dialog box that can ameliorate a lot of this (type checking in particular), but yes, moving to Universal Headers will certainly be a breaking change for a lot of code. Most of the changes are fairly trivial but for education purposes and with respect to the most popular (in my mind, anyway?) vintage era of 68K machines, sticking with THINK C 6 makes the most sense to me.