Slashdot Mirror


ANSI C89 and POSIX portability?

LordNite asks: "Here is the situation. I am maintaining a piece of source code which is written in K&R C. One of the original goals of this code was to be as portable as possible to as many platforms as possible. The code runs on UNIX and its clones as well as OS/2. The code avoids POSIX functions such as mmap(2) since at the time it was initially written (early 1990s) POSIX was not very wide spread. The code is well written, but in need of some serious fixing. As I go around fixing parts of the code I would also like to modernize it a bit. Since it is now 2004, can I rely on ANSI C89 and POSIX routines without sacrificing the portability of this code? (Yes, I do realize that the purpose of POSIX is code portability...) I am not really interested in the OS/2 port at this time. I am just interested in keeping portability with UNIX clones. To put my question another way: Are there any UNIX-like OSes in common use, which are currently developed and supported by some entity either OSS or proprietary, that do not support POSIX and ANSI C89?"

6 of 85 comments (clear)

  1. The story should have read: by Anonymous Coward · · Score: 0, Funny

    "Ask Slashdot: Can I revise my code?" Dear Slashdot community, I've got some old code; can I revise old code? Thanks.

  2. I'd just go with well documented Visual Basic by Clockwurk · · Score: 2, Funny
  3. Re:POSIX and C89 by Elm+Tree · · Score: 3, Funny

    <SARCASM>

    Wait...
    I think you missed a major version of unix there. In fact the only *real* unix, SCOWare. They even own the copyright on "UNIX".

    </SARCASM>

  4. Re:put the project code online by Anonymous Coward · · Score: 1, Funny
    shitfuck() system call. Sounds messy.

    It's still better than vfork().

  5. yeah and when i rotated your tires by Anonymous Coward · · Score: 1, Funny

    at the tire shop, i saw that your engine was running on gasoline. how barbaric, i thought, so i upgraded it to hydrogen.

  6. Re:Purpose? by Omega1045 · · Score: 2, Funny
    That's pretty patronizing. Or maybe the word is fascist.

    Me thinks we have a spy, fellow Slashdotters! This person (parent comment author) sounds more like a drama student than a programmer!

    --

    Great ideas often receive violent opposition from mediocre minds. - Albert Einstein