]> git.codecow.com Git - Monocypher.git/commitdiff
extract_examples.sh: warning cleanup
authorFabio Scotoni <34964387+fscoto@users.noreply.github.com>
Mon, 2 Mar 2020 07:36:52 +0000 (08:36 +0100)
committerFabio Scotoni <34964387+fscoto@users.noreply.github.com>
Mon, 2 Mar 2020 07:36:52 +0000 (08:36 +0100)
1. Remove now-unused random_bytes().
2. "warning: empty struct has size 0 in C, size 1 in C++ [-Wc++-compat]"
   "warning: empty struct is a GNU extension [-Wgnu-empty-struct]"
   clang -Weverything

doc/extract_examples.sh

index 78fb5f8446b7d40c738531f190a17bbbe3524f65..71ea9b39f87a7e5d5e7a13586667af38d84d9379 100755 (executable)
@@ -58,16 +58,12 @@ cat << END
 #include "../src/monocypher.h"
 #include "../src/optional/monocypher-ed25519.h"
 
-typedef struct SHA2_CTX { } SHA2_CTX;
+typedef struct SHA2_CTX { void *x; } SHA2_CTX;
 void SHA512Init(SHA2_CTX*);
 void SHA512Update(SHA2_CTX*, const void*, size_t);
 void SHA512Final(uint8_t*, SHA2_CTX*);
 void arc4random_buf(void*, size_t);
 
-static void random_bytes(uint8_t *buf, size_t len)
-{
-    arc4random_buf(buf, len);
-}
 
 int main() {
 END