Project

General

Profile

Actions

Bug #922

closed

"struct user" exposed through stdlib.h

Added by Adrien B. over 9 years ago. Updated over 9 years ago.

Status:
Completed
Priority:
High
Assignee:
Category:
libcrystax
Target version:
Start date:
04/08/2015
Due date:
% Done:

100%

Estimated time:
CPU Architecture:
arm
Host OS:
Linux
Toolchain:
gcc-4.9
Android version:
4.0.3 (android-15)
CrystaX NDK Version:

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 {
^

Actions #1

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.

Actions #2

Updated by Dmitry M. over 9 years ago

  • Status changed from Open to In Progress
Actions #3

Updated by Dmitry M. over 9 years ago

  • Priority changed from Normal to High
Actions #5

Updated by Dmitry M. over 9 years ago

  • Target version set to 10.2.0
Actions

Also available in: Atom PDF