Bug #922
closed"struct user" exposed through stdlib.h
100%
Description
Not 100% sure it's not a PJSIP bug, however it compiles fine with vanilla NDK (for now I just renamed the structure "user" defined by PJSIP).
../src/pjmedia/transport_loop.c:31:8: error: redefinition of 'struct user'
struct user
^
In file included from /home/adrien/crystax-ndk-10.1.0/platforms/android-15/arch-arm/usr/include/sys/user.h:35:0,
from /home/adrien/crystax-ndk-10.1.0/platforms/android-15/arch-arm/usr/include/crystax/google/sys/ucontext.h:33,
from /home/adrien/crystax-ndk-10.1.0/platforms/android-15/arch-arm/usr/include/sys/ucontext.h:36,
from /home/adrien/crystax-ndk-10.1.0/platforms/android-15/arch-arm/usr/include/signal.h:42,
from /home/adrien/crystax-ndk-10.1.0/platforms/android-15/arch-arm/usr/include/sys/wait.h:35,
from /home/adrien/crystax-ndk-10.1.0/platforms/android-15/arch-arm/usr/include/crystax/sys/stdlib.h:40,
from /home/adrien/crystax-ndk-10.1.0/platforms/android-15/arch-arm/usr/include/stdlib.h:47,
from ../../pjlib/include/pj/compat/string.h:43,
from ../../pjlib/include/pj/string.h:29,
from ../include/pjmedia/frame.h:28,
from ../include/pjmedia/port.h:30,
from ../include/pjmedia/codec.h:29,
from ../include/pjmedia/stream.h:29,
from ../include/pjmedia/transport_loop.h:29,
from ../src/pjmedia/transport_loop.c:20:
/home/adrien/crystax-ndk-10.1.0/platforms/android-15/arch-arm/usr/include/crystax/google/sys/user.h:213:8: note: originally defined here
struct user {
^
Updated by Dmitry M. over 9 years ago
- Category changed from build to libcrystax
- Assignee set to Dmitry M.
Strictly speaking, this is bug in PJSIP - just because @struct user@ is part of linux headers and there are no requirement in any standard that @stdlib.h@ should not expose it (there are requirements to expose some definitions, but definitely no requirements to not expose something). However, taking into account this could be common issue, I'll try to fix this in our NDK.
Just to explain why this happens: @stdlib.h@ should expose @WEXITSTATUS@, @WIFEXITED@ and similar macros, according to IEEE Std 1003.1, 2013 Edition. To do that, we've included @sys/wait.h@ into @stdlib.h@ (as this file is place where @WEXITSTATUS@, @WIFEXITED@ and others are defined), which by turn finally includes @sys/user.h@, where @struct user@ defined.
Updated by Dmitry M. over 9 years ago
- Status changed from In Progress to Completed
- % Done changed from 0 to 100