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

main fails to compile #67

Open
mouse07410 opened this issue Dec 15, 2023 · 0 comments
Open

main fails to compile #67

mouse07410 opened this issue Dec 15, 2023 · 0 comments

Comments

@mouse07410
Copy link

MacOS Sonoma 14.1.2, Xcode-15.1

[ 25%] Building C object ref/CMakeFiles/test_kyber512_ref.dir/test_kyber.c.o
/Users/ur20980/src/kyber/ref/test_kyber.c:9:21: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static int test_keys()
                    ^
                     void
/Users/ur20980/src/kyber/ref/test_kyber.c:34:29: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static int test_invalid_sk_a()
                            ^
                             void
/Users/ur20980/src/kyber/ref/test_kyber.c:62:35: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static int test_invalid_ciphertext()
                                  ^
                                   void
3 errors generated.

Proposed fix is obvious (it also addresses the fact that MacOS has shasum, but not sha256sum):

index 313ab24..6bc127d 100644
--- a/ref/CMakeLists.txt
+++ b/ref/CMakeLists.txt
@@ -114,4 +114,8 @@ else()
   add_test(NAME vectors1024-90s_ref COMMAND sh -c "\"$<TARGET_FILE:test_vectors1024-90s_ref>\" > tvecs1024-90s")
 endif()
 
-add_test(NAME hashes COMMAND sha256sum -c ../../SHA256SUMS)
+if (DARWIN)
+  add_test(NAME hashes COMMAND shasum -a 256 -c ../../SHA256SUMS)
+else()
+  add_test(NAME hashes COMMAND sha256sum -c ../../SHA256SUMS)
+endif(DARWIN)
diff --git a/ref/test_kyber.c b/ref/test_kyber.c
index 0f28af5..cac6b41 100644
--- a/ref/test_kyber.c
+++ b/ref/test_kyber.c
@@ -6,7 +6,7 @@
 
 #define NTESTS 1000
 
-static int test_keys()
+static int test_keys(void)
 {
   uint8_t pk[CRYPTO_PUBLICKEYBYTES];
   uint8_t sk[CRYPTO_SECRETKEYBYTES];
@@ -31,7 +31,7 @@ static int test_keys()
   return 0;
 }
 
-static int test_invalid_sk_a()
+static int test_invalid_sk_a(void)
 {
   uint8_t pk[CRYPTO_PUBLICKEYBYTES];
   uint8_t sk[CRYPTO_SECRETKEYBYTES];
@@ -59,7 +59,7 @@ static int test_invalid_sk_a()
   return 0;
 }
 
-static int test_invalid_ciphertext()
+static int test_invalid_ciphertext(void)
 {
   uint8_t pk[CRYPTO_PUBLICKEYBYTES];
   uint8_t sk[CRYPTO_SECRETKEYBYTES];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant