Skip to content

Commit dfbb5ec

Browse files
committed
MSVC compile: higher warning-level -Wall, but warning-free
1 parent 380d03b commit dfbb5ec

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

demo/test.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ static int test_mp_invmod(void)
622622

623623
}
624624

625+
#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559)
625626
static int test_mp_set_double(void)
626627
{
627628
int i;
@@ -632,7 +633,6 @@ static int test_mp_set_double(void)
632633
}
633634

634635
/* test mp_get_double/mp_set_double */
635-
#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559)
636636
if (mp_set_double(&a, +1.0/0.0) != MP_VAL) {
637637
printf("\nmp_set_double should return MP_VAL for +inf");
638638
goto LBL_ERR;
@@ -670,7 +670,6 @@ static int test_mp_set_double(void)
670670
goto LBL_ERR;
671671
}
672672
}
673-
#endif
674673

675674
mp_clear_multi(&a, &b, NULL);
676675
return EXIT_SUCCESS;
@@ -679,6 +678,7 @@ static int test_mp_set_double(void)
679678
return EXIT_FAILURE;
680679

681680
}
681+
#endif
682682

683683
static int test_mp_get_u32(void)
684684
{
@@ -2112,7 +2112,9 @@ int unit_tests(int argc, char **argv)
21122112
T(mp_read_radix),
21132113
T(mp_reduce_2k),
21142114
T(mp_reduce_2k_l),
2115+
#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559)
21152116
T(mp_set_double),
2117+
#endif
21162118
T(mp_signed_rsh),
21172119
T(mp_sqrt),
21182120
T(mp_sqrtmod_prime),

makefile.msvc

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PREFIX = c:\devel
1414
CFLAGS = /Ox
1515

1616
#Compilation flags
17-
LTM_CFLAGS = /nologo /I./ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /W3 $(CFLAGS)
17+
LTM_CFLAGS = /nologo /I./ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /Wall /wd4146 /wd4127 /wd4710 /wd4711 /wd4820 $(CFLAGS)
1818
LTM_LDFLAGS = advapi32.lib
1919

2020
#Libraries to be created (this makefile builds only static libraries)
@@ -60,7 +60,7 @@ $(OBJECTS): $(HEADERS)
6060
.c.obj:
6161
$(CC) $(LTM_CFLAGS) /c $< /Fo$@
6262

63-
#Create tomcrypt.lib
63+
#Create tommath.lib
6464
$(LIBMAIN_S): $(OBJECTS)
6565
lib /out:$(LIBMAIN_S) $(OBJECTS)
6666

0 commit comments

Comments
 (0)