0

So I have a few very closely related questions (sequential).

  • Is POSIX managed by the C standard committee or is it merely a standard to enable cross-platform functionalities?
  • Are the standards released with disregard to POSIX?
  • If you're working on some new chip / os and are creating a non-POSIX compliant C implementation for that system, is your os considered portable (since you're complying to the C standard)?
  • Will the C standards and POSIX standards stay separate in the future?

Big thanks to anyone who has read my question, and of course to anyone who has written an answer.

  • @MortenJensen Not all of them, so I'm going to update my question. Would you mind removing the feedback please? (if you see fit) – gokala2574 Sep 06 '21 at 19:16
  • Short answer, POSIX and C-Standard and apples and oranges. Both fruit, but quite different. – David C. Rankin Sep 06 '21 at 19:20
  • @MortenJensen I've updated my answer, you can check it out now. – gokala2574 Sep 06 '21 at 19:21
  • @DavidC.Rankin I've updated my question, but thanks for the answer. I'm just trying to understand that very difference. – gokala2574 Sep 06 '21 at 19:22
  • They are different standards. See [POSIX Standard](https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/) and you know were the C-Standard lives. In C you will have a number of functions provided by POSIX as an extension to the C-Standard library. This is the difference between "Strictly Conforming" (C-Standard Only) or "Conforming", C plus other standards. Strictly conforming guarantees portability. – David C. Rankin Sep 06 '21 at 19:28
  • @DavidC.Rankin You said Strictly Conforming means C Standard Only, but then said that Strictly Conforming guarantees portability. Isn't the whole purpose of POSIX to enable portability? – gokala2574 Sep 06 '21 at 19:36
  • @DavidC.Rankin So if you want pure standard C, and want to target as many platforms as possible (including old ones), should you divert from POSIX defined stuff? – gokala2574 Sep 06 '21 at 19:38
  • The standards approach portability from different angles. C-standard is specific to C, POSIX covers a number of areas as well. Just as you wouldn't look to the C-standard to determine Shell portability, you don't look at POSX to determine C portability. They serve different purposes. (and there is the historical hodge-podge of features from many sources, BSD, Unix, etc that POSIX sought to address in its standard). Take the POSIX function `strdup()`, it isn't part of the C-standard library, but many compilers provide it. You can look at the `CONFORMING TO` section of the man-page for help. – David C. Rankin Sep 06 '21 at 19:48
  • @DavidC.Rankin Excellent explanation, thanks a lot! – gokala2574 Sep 06 '21 at 20:55

0 Answers0