[nanomsg] Re: Survey: Visual Studio editions

  • From: "Garrett D'Amore" <garrett@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Tue, 21 Nov 2017 16:06:21 +0000

its used more than that. snprintf is safe to use.
On Mon, Nov 20, 2017 at 7:24 AM ccpaging <ccpaging@xxxxxxxxx> wrote:

`sprintf` is a huge hole in C. Many developer use their own version in C++
or C.


https://chromium.googlesource.com/chromium/src.git/+/master/base/strings/safe_sprintf.cc

https://github.com/c42f/tinyformat

https://github.com/idning/safe_snprintf/blob/master/safe_snprintf.c

I found only twice calling snprintf in nanomsg.

Is it really necessary?


2017-11-18 0:13 GMT+08:00 Garrett D'Amore <garrett@xxxxxxxxxx>:

There are other problems too. Old editions of VS have broken
implementations of snprintf for example.
On Thu, Nov 16, 2017 at 9:18 PM ccpaging <ccpaging@xxxxxxxxx> wrote:

Compatible C99 is the problem of Visual Studio 2008.

Another solution is let the compiler adding "stdint.h" and "stdbool.h"
to Visual Studio 2008's "VC/include".

Just test it using
https://github.com/Microsoft/PlistCpp/blob/master/Windows/include/stdint.h

Everything is OK.

Best regards
ccpaging


2017-11-16 23:16 GMT+08:00 SGSeven Algebraf <a1rex2003@xxxxxxxxx>:

The only problem here is a licence. The file can not be taken as is.

A google search found a few replacements:


https://github.com/Microsoft/PlistCpp/blob/master/Windows/include/stdint.h


https://github.com/alanxz/rabbitmq-c/blob/master/librabbitmq/win32/msinttypes/stdint.h

http://www.nongnu.org/avr-libc/user-manual/stdint_8h_source.html



On Thu, Nov 16, 2017 at 4:11 AM, ccpaging <ccpaging@xxxxxxxxx> wrote:

Just test it in Visual Studio 2008.

Using cmake create sln project, OK.

Since 2008 do not have stdint.h, I create a include file "stdint_nn.h".

change all <stdint.h> to "stdint_nn.h", everything is OK.

"stdint_nn.h" based on libzmq's "stdint.hpp". See attach file.

Is there any other solution? I shill try it.

Best regards
ccpaging


在 2017/11/12 2:36, Garrett D'Amore 写道:

(Ignore this message if you don’t use Visual Studio to build Windows
apps.)

I’m contemplating building in a requirement for VIsual Studio 2013 or
newer for the new nng library.  (Today it works with older revs, but I
don’t test anything too old.)

The motivation here is that the 2013 edition introduced C99 support
(incomplete though), so that I can start using things like <stdbool.h> 
and
<stdint.h>

Do you use support for older versions of Visual Studio with nanomsg?
What about with nng?  How disruptive would it be for you if nng were to
require Visual Studio 2013 or newer?  What about 2015 or newer?  What if
nng permitted using older compilers to build *against* nng, provided that
nng itself were compiled with a sufficiently modern edition of VS?

 - Garrett






Other related posts: