lammertb / libhttp

Multi platform HTTP and HTTPS library
MIT License
958 stars 131 forks source link

Error making on macOS 12.3.1 #76

Open anatolio-deb opened 2 years ago

anatolio-deb commented 2 years ago

Running make -f Makefile.osx :

cc -c  -Wall -Wextra -Wstrict-prototypes -Wshadow -Wpointer-arith -Wformat-security -Winit-self -Wcast-qual -Wcast-align -Wwrite-strings -Wnested-externs -Wredundant-decls -Werror -O3 -funsigned-char -Iinclude/ -DUSE_STACK_SIZE=102400 -oobj/extern_md5.o src/extern_md5.c
src/extern_md5.c:250:16: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction]
                        if (!((data - (const md5_byte_t *)0) & 3)) {
                                    ^ ~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [obj/extern_md5.o] Error 1

GCC version:

gcc --version
Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: arm64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I'm a newbie in C, but could it somehow relate to Apple M1 chip or a gcc version?

exanter commented 1 year ago

Trying to get it compiled currently, on Mac (intel). I hacked a few things, got it to compile. Feel free to hit me up, I'll tell you how, will maybe do a PR when I have more time.

NoahStoessel commented 1 year ago

Trying to get it compiled currently, on Mac (intel). I hacked a few things, got it to compile. Feel free to hit me up, I'll tell you how, will maybe do a PR when I have more time.

hello could you help me too? having the same error on my intel mac