nondeterministic / mailfilter

Remotely filters out spam in POP-accounts via regular expressions
http://mailfilter.sf.net
GNU General Public License v2.0
2 stars 4 forks source link

Fix warnings about incorrect prototypes & use standard memcpy/memset #7

Open hhoffstaette opened 2 years ago

hhoffstaette commented 2 years ago

Clang-15 rightfully complains about function definitions without proper prototypes. Also replace handrolled memcpy/memset with standard C library calls.

Signed-off-by: Holger Hoffstätte holger@applied-asynchrony.com

hhoffstaette commented 2 years ago

In case you're wondering:

clang -DHAVE_CONFIG_H -I. -I..  -I/usr/local/include -I. -I../include -I.. -DLOCALEDIR=\"/usr/local/share/locale\" -I../intl -I.. -I../include -I.   -g -O2 -MT md5c.o -MD -MP -MF .deps/md5c.Tpo -c -o md5c.o md5c.c
md5c.c:97:6: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void MD5Init (context)
     ^
md5c.c:113:6: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void MD5Update (context, input, inputLen)
     ^
md5c.c:155:6: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void MD5Final (digest, context)
     ^
md5c.c:183:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static void MD5Transform (state, block)
            ^
md5c.c:183:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
md5c.c:275:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static void Encode (output, input, len)
            ^
md5c.c:275:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
md5c.c:293:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static void Decode (output, input, len)
            ^
md5c.c:293:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
md5c.c:308:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static void MD5_memcpy (output, input, len)
            ^
md5c.c:308:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
md5c.c:321:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static void MD5_memset (output, value, len)
            ^
md5c.c:321:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]

I didn't even know it was possible to define functions this way.. ¯\_(ツ)_/¯

hhoffstaette commented 2 years ago

Btw I'm running this change on my server and it seems to work fine so far - just to make sure I didn't break anything. I mean..handrolled memcpy.. :sob: