News for hackers. Stuff that matters.
Re:Best aspects of C by int_19h on Thursday November 19, 2020 @04:10PM (#25154391)
C is write once, compile anywhere... so long as you restrict yourself to standard C, including the library. Different implementations have different levels of standard compliance, but you are still able to say, "this will do X on any conformant hosted C89 implementation".

The moment you start doing things like threads or shared libraries, yeah, it all breaks down very quickly. But that isn't standard C.

Re:Best aspects of C by sumtechguy on Monday November 23, 2020 @11:42AM (#25188603)
Even things like printf/sprintf act differently from library to library. trust me, read the docs on your lib. Most of the time they are the same but not always. It is one of those things that looks like it works but in practice there are a ton of gotchas. Most of the more mature libraries are getting better but there are some edge cases out there.
Re:Best aspects of C by int_19h on Monday November 23, 2020 @06:25PM (#25193155)
They are different mostly because of different standards that libraries support - C90 has a baseline list of %-specifiers, but C99 added a bunch more, and then I think POSIX also has some now? Plus extensions.

But I can't think of any implementation that doesn't conform to C90 in that regard. So long as you don't venture into implementation defined / UB category...