Mail Archives: djgpp/1999/12/18/03:16:16
Mark Hathaway wrote:
>
> Hello all,
>
> I'm new to this newsgroup and sorta new to C, so I need to be -> pointed
^^^^^^^^^^^^^^ you mean, these newsgroups?
> in the right direction for some information.
I've cut down the crossposted newsgroups to this one only.
> In my studying of FAQs and such I keep seeing references to functions
> which are flaky or difficult to use or non-portable or non-standard.
> So, I need some questions answered or to be pointed to the answers.
>
> Questions:
>
> 1. Which C library functions is it best to avoid for one reason or
> another?
Depends on your goals. Avoid functions that will hurt your goals. If
you are writing Windows applications, avoid fork(). If you are writing
cross-platform applications, avoid GetPrivateProfileString().
> 2. Which C library functions are ANSI/ISO?
K&R II, pp. 241--258.
> 3. Which C library functions are portable?
ANSI/ISO functions, POSIX function, Win32 functions. Each set is
portable in a specific group of platforms.
> 4. Which are NOT ANSI/ISO or portable, but are still very useful and
> are needed at some times?
WinMain() is pretty indispensible for Win32 applications, although not
in the ANSI/ISO standard.
> 5. Which in gcc (I use DJGPP) use language extensions?
The standard functions are guaranteed to behave in a certain way. The
fact that their implementation may relies on language extensions should
not matter to the application programmer.
> 6. Which raises the question of what the extensions are that gcc (DJGPP)
> support?
It's best that you don't know them. Stuff you learn from regular C
books are unlikely compiler extensions.
> I haven't seen the answers to these questions in the FAQs I've read, but
> it would seem very useful to have them answered somewhere online.
Kernighan & Pike's new book, The Practice of Programming, has a whole
chapter on portability.
--
Weiqi Gao
weiqigao AT a DOT crl DOT com
- Raw text -