This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/CC2538: How to resolve P-Thread Warning while Building "Zigbee Linux Gateway Application".

Part Number: CC2538


Tool/software: Linux

Hello E2E Community,

I am using CC2538-CC2592 Development module with BBB, I am using the Z-stack Linux Gateway 3.0 Application code.

As per instructions in the "Z-Stack Linux Gateway Developers Guide.pdf" I had Build the application code by running ./build_all script.

I am getting some warnings related to P-THREAD in Trace.c file functions.

will you help me to resolve this issue?..

The logs for trace.c in the ./build_all are given below.

Compiling ./../../srvwrapper/trace.c into trace.o
In file included from ./../../srvwrapper/trace.c:52:0:
./../../srvwrapper/trace.c: In function ‘trace_init_thread’: ./../../srvwrapper/trace.h:198:42: warning: right-hand operand of comma expression has no effect [-Wunused-value]

#define PTHREAD_SETSPECIFIC(A,B) ((A)=(B),0) ~~~~~~~~^~~ ./../../srvwrapper/trace.c:187:3: note: in expansion of macro ‘PTHREAD_SETSPECIFIC
PTHREAD_SETSPECIFIC(thread_name_key, NULL); ^~~~~~~~~~~~~~~~~~~

Thanks & Regard's

Shiv Patil.

  • Hello Shiv,

    There are several warning generated during package build (including this one) that do not affect operation of the Linux Gateway, are you noticing any strange behavior to which you believe this warning is related?

    Regards,
    Ryan
  • Hello Ryan,

    I had noticed that,

    Due to this warning the output files of build's will be created in "Error_Out" directory instead of "out" directory.
    No matters my code is working properly even building the code throws this kind of warnings.

    but i am very curious to know,
    why this warning will be raised when i am running the ./build_all script?...

    will you please help me to understand those things.


    Regards,
    Shiv Patil.
  • Hello shiv,

    Yes, the Error_Out directory will be created instead of out if any errors or warnings exist during the build or if the directory generated does not match the expected content. This can all be modified to your liking inside of the scripts/package_builder which is executed by build_all.

    Regards,
    Ryan
  • Hello Ryan,

    Completely understood what you are saying.


    But,

    I wants to know about P-thread implementation in Zigbee Linux Gateway Application.

    #define PTHREAD_SETSPECIFIC(A,B) ((A)=(B),0)

    1. What is the role of PTHREAD_SETSPECIFIC() ?
    2. What A & B stands for, in this function arguments?
    3. Why this argument passed with some relational operations between them?.. // (A , B) OR ((A)=(B),0)

    Will you please help me to know this fundamentals?...


    Regards,
    Shiv Patil.

  • Hello Shiv,

    I did not develop this application and have no experience with POSIX Threads, please refer to corresponding documentation regarding pthread and c syntax for further insight.

    Regards,
    Ryan