Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Contributing and coding standards?

Just out of curiosity, why are you folks looking at the Embedded C library if you have a POSIX system rather than the Paho C library?


On 11/15/18 7:34 PM, Greg Troxel wrote:
I definitely am in favor of writing to the POSIX spec instead of linux
man pages.  That gets you portability to a huge range of systems,
including ones you don't even know exist.

Usually, libraries are written to POSIX, perhaps relying on as little as
necessary.  But, there are platforms which are much less than POSIX,
like the Arduino IDE.  I am not quite clear on if your platform is not
posix (an unhosted environment like one might have with the Arduino
IDE?) or if you are just wanting things to be leaner.  It seems to me
that lean, and a non-POSIX environment are two separate issues, and that
lean would benefit almost everyone, especially if the issue is CPU and
memory use vs code size.

About socket and timer: when designing for arbitrary less-than-POSIX
environments where you try to assume C99 (or C++NN) and no further, you
run into needing various things that aren't in that spec, and then
defining interfaces that the platform has to define to use the library.
I think that's what you mean about Socket and Timer.
I would suggest, without certainty, that if you need something that
exists in POSIX (like sockets), that you consider using that or a
defined subset, and then ask the platform to define the calls that POSIX
expects.  This reduces brain effort for readers, as they know the
interface, and you will probably find that many systems that are C99 but
not POSIX do various things that are posixy the posix way.

Also, it may be good to have the platform API in C, not C++ - but that
may be my old-school bias showing.

Hope this helps...
paho-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top