Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!ucbvax!bloom-beacon!oberon!skat.usc.edu!blarson From: blarson@skat.usc.edu (Bob Larson) Newsgroups: comp.lang.c Subject: Re: portability Message-ID: <14837@oberon.USC.EDU> Date: 21 Jan 89 01:37:29 GMT References: <16573@iuvax.cs.indiana.edu> <14767@oberon.USC.EDU> <16653@iuvax.cs.indiana.edu> Sender: news@oberon.USC.EDU Reply-To: blarson@skat.usc.edu (Bob Larson) Organization: USC AIS, Los Angeles Lines: 35 In article <16653@iuvax.cs.indiana.edu> bobmon@iuvax.cs.indiana.edu (RAMontante) writes: ><14767@oberon.USC.EDU> blarson@skat.usc.edu (Bob Larson) writes: >>cdecl is a keyword only because >>microsoft was to lazy to add a few #defines to their programs. It does >>nothing that could not be accomplished better in the preprocessing phase. >Well, I'm talking specifically about TurboC's use of the keywords; in >TC the 'cdecl' keyword means that a function follows the 'C' linking >and arg-passing conventions, and identifiers are case-sensitive and get >leading underbars, Simplified, cdecl means do things as they are done in C. > even though the overall default may be 'pascal'-like. The compiler option to change these overall defaults is the problem, eliminating it the proper solution, not cdecl. To change the calling convention from the norm, add a keyword to each fuction declaration that may change rather than adding the compiler flag. If there is a need to change the calling convention at compile time, just add a preprocesser token to all non-standard routines (such as CALLING_CONVENTION_OF_THIS_COMPILATION) and use the compiler switch to #define it to pascal or null or fortran. Prime C has the fortran keyword, and never found a need for the cdecl one. It also runs on a segmented processor (128k bytes each), and has no near, far, or huge keywords. (It does have the equivelent of large and huge model, which only affect how address computations are done on arrays whose size cannot be deduced at compile time.) -- Bob Larson Arpa: Blarson@Ecla.Usc.Edu blarson@skat.usc.edu Uucp: {sdcrdcf,cit-vax}!oberon!skat!blarson Prime mailing list: info-prime-request%ais1@ecla.usc.edu oberon!ais1!info-prime-request