muparser icon indicating copy to clipboard operation
muparser copied to clipboard

Some build warnings

Open lailoken opened this issue 1 year ago • 1 comments

Just warnings, but thought you may benefit from this report.

PS: I just find this project basically perfect from my needs, I've (re-)implemented this so many times (parsers/compilers) and always found mine lacking somehow. There are things I desire but adding them will just detract from the simplistic beauty. :P

In muParserFixes.h I see a typo:

	#ifdef MUPARSERLIB_EXPORTS /* defined if we are building the muParser DLL (instead of using it) */
		#define API_EXPORT_CXX MUPARSER_HELPER_DLL_EXPORT
	#else
		#define API_EXPORT_CXX MUPARSER_HELPER_DLL_IMPORT
	#endif /* MUPARSER_DLL_EXPORTS */

This mentions MUPARSER_DLL_EXPORTS incorrectly,

However, the above code is not compiled for me since I am building statically, yet I see in CMakeLists.txt:

# This compiles the "DLL" interface (C API)
target_compile_definitions(muparser PRIVATE MUPARSER_DLL)

this is defined even if I'm building statically.

Which is also giving a warning for me in muParserDLL.cpp because my project already defines WIN32_LEAN_AND_MEAN and this file redefines it:

#if defined(_WIN32)
	#define WIN32_LEAN_AND_MEAN
	#define _CRT_SECURE_NO_WARNINGS
	#define _CRT_SECURE_NO_DEPRECATE

	#include <windows.h>
#endif

Is this all correct, or can it be cleaned up a little?

lailoken avatar May 10 '24 13:05 lailoken

Thanks for reporting this.

If i remember correctly the build system is set up in a way that even the static library contains the C-API from the dll. So you could build a static lib and still use the C-API. That happend more or less by accident but the problem is if its in there i cannot remove it since someone somewhere may actually be using it.

What could be done without changing too much and especially not the library API is to put an additional include guard around the WIN32_LEAN_AND_MEAN definition. That should fix the warning that you are seeing.

beltoforion avatar May 30 '24 22:05 beltoforion