Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

fails to build with musl libc due to use of caddr_t #40

Closed
ncopa opened this issue Oct 28, 2014 · 0 comments · Fixed by #41
Closed

fails to build with musl libc due to use of caddr_t #40

ncopa opened this issue Oct 28, 2014 · 0 comments · Fixed by #41

Comments

@ncopa
Copy link
Contributor

ncopa commented Oct 28, 2014

This happens when trying to build with musl libc on Alpine Linux:

ccache gcc -DNDEBUG -Os -fomit-frame-pointer -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIC -I/usr/include/python2.7 -c source/c_gpio/c_gpio.c -o build/temp.linux-i686-2.7/source/c_gpio/c_gpio.o
source/c_gpio/c_gpio.c: In function 'setup':
source/c_gpio/c_gpio.c:82:35: error: 'caddr_t' undeclared (first use in this function)
     gpio_map = (uint32_t *)mmap( (caddr_t)gpio_mem, BLOCK_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, mem_fd, GPIO_BASE);
                                   ^

the caddr_t should be replaced with void *.
see http://stackoverflow.com/questions/6381526/what-is-the-significance-of-caddr-t-and-when-is-it-used

ncopa added a commit to ncopa/RPIO that referenced this issue Oct 28, 2014
caddr_t is a legacy BSD type which was rejected by the POSIX standard.
Use void * instead.

This solves a build failure with musl libc.

Fixes metachris#40
2m pushed a commit to 2m/RPIO that referenced this issue Oct 3, 2020
caddr_t is a legacy BSD type which was rejected by the POSIX standard.
Use void * instead.

This solves a build failure with musl libc.

Fixes metachris#40
2m pushed a commit to 2m/RPIO that referenced this issue Oct 3, 2020
caddr_t is a legacy BSD type which was rejected by the POSIX standard.
Use void * instead.

This solves a build failure with musl libc.

Fixes metachris#40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant