Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent _snprintf define #1115

Open
KBaur opened this issue Jul 22, 2019 · 2 comments

Comments

@KBaur
Copy link

commented Jul 22, 2019

Description

Above VS2015 the

#define snprintf _snprintf

is no longer necessary and will cause problemens on compiling with windows.

Steps to Reproduce

In
itkImageSeriesWriter.hxx line 32
libsrc2/minc2_pricate.h line 213
include/minc2_private.h line 213
libmin/libsrc2/minc2_private.h line 213

#if _MSC_VER
#define snprintf _snprintf
#endif // _MSC_VER

change to

#if _MSC_VER < 1900 /* MSVC-14 defines real snprintf()... just about time! */
#define snprintf _snprintf
#endif // _MSC_VER

Expected behavior

Actual behavior

Reproducibility

Versions

ITK 5.0.0

Environment

OS: Windows
Platform Toolset: MSVS 2017 Visual Studio 2017 (v141)
Windows SDK Version: 10.0.15063.0

Additional Information

@KBaur KBaur added the type:Bug label Jul 22, 2019

@dzenanz

This comment has been minimized.

Copy link
Member

commented Jul 22, 2019

@gdevenyi I guess this should be changed in MINC, and then we should update ITK's version of MINC.

vfonov added a commit to BIC-MNI/libminc that referenced this issue Jul 22, 2019

@TMeindl

This comment has been minimized.

Copy link

commented Jul 23, 2019

I think the patch for libsrc2/minc2_private.h still needs

#define strncasecmp strnicmp
#define strcasecmp stricmp

in the common case if _MSC_VER is defined.

See attached patch:
ITK-5.0.0-snprintf.patch.txt

vfonov added a commit to BIC-MNI/libminc that referenced this issue Jul 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.