-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
fixed libtest linker error on msvc #144
Conversation
IMHO, adding |
@gvanem according to documentation _snprintf has different semantic from snprintf (for example http://stackoverflow.com/questions/7706936/is-snprintf-always-null-terminating/13067917#13067917). If this not important I can do the trick with little update in CMakeLists.txt Waiting for more comments. |
I don't think |
Your patch removes the use of the internal snprintf(), why does that solve the problem? Why shouldn't the windows built versions also use that? |
@bagder it not removes. I include it in single place test.h and remove duplication. |
Ah, thanks for clearing that out. I was clearly not reading the whole patch. With me being corrected. I can't see any problems with this patch! |
Oh, unless of course you build with CURLDEBUG defined. It shows we have some further cleaning up work to do... (use of sprintf() that we frown upon) |
Ok. Will check it soon. Perhaps I'll need also update cmake build to honor CURLDEBUG option, because I'm not currently aware of that. |
Ah right. With the configure build you use --enable-debug to switch it on, and it enables extra debugging info, checks and outputs in various way. |
Well, some clarification --enable-curldebug - enables TrackMemory feature, while --enable-debug - enables both (Debug && TrackMemory). Am I correct? Another question - should it be wirtten to curlbuild.h or as autoconfig do - just set definition to Makefiles? |
I've submitted another pull request #145 to handle CURLDEBUG define for build in cmake. |
@bagder what should we do, when CURLDEBUG enabled?
|
I think that since curl/mprintf.h is a public header, it should not feature that #ifdef in the first place. I think I'll help out here and move that debug-#define sequence into a private libcurl header instead. |
Thanks, I cleaned up the include thing first, then merged your patch! |
The issue:
How to reproduce:
Suggested solution:
mprintf.h header added to test.h to prevent future issues in libtest