[pjsip] Code Compilation Errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  

Hi Benny,

I am integrating the latest 0.7.1 code branch, and I have a few issues
I'd like to report back to you.

1.    Unreachable code.

The following code in sip_auth_client.c produces four warnings of
'unreachable code' for the code that comes after it.

#if !PJSIP_HAS_DIGEST_AKA_AUTH

            pj_assert(!"PJSIP_HAS_DIGEST_AKA_AUTH is not enabled");

            return PJSIP_EAUTHINAKACRED;

#endif

If this code could be changed to the following, it is functionally
equivalent, but eliminates the compiler warnings:

#if !PJSIP_HAS_DIGEST_AKA_AUTH

            if(!PJSIP_HAS_DIGEST_AKA_AUTH)

            {

                  pj_assert(!"PJSIP_HAS_DIGEST_AKA_AUTH is not
enabled");

                  return PJSIP_EAUTHINAKACRED;

            }

#endif

By adding the if-statement, the compiler thinks that the code branch is
conditional.  However, it will always be true for the given compile
scenario.

2.    Linker error: the constant PJ_SOL_TCP is not defined.  In the
sock_bsd.c source file, the following code precludes the definition of
the PJ_SOL_TCP constant:

#if defined(SOL_TCP)

const pj_uint16_t PJ_SOL_TCP  = SOL_TCP;

#elif defined(IPPROTO_TCP)

const pj_uint16_t PJ_SOL_TCP  = IPPROTO_TCP;

#endif /* SOL_TCP */

Since the preprocessor definitions for SOL_TCP and IPPROTO_TCP are not
defined anywhere, the PJ_SOL_TCP constant does not get defined.  The new
sock_common.c file references the PJ_SOL_TCP constant in the
pj_SOL_TCP() function, which produces the linker error.  There needs to
be a default value provided.  By studying the surrounding code, my best
guess is to default to 0xFFFF like so:

#if defined(SOL_TCP)

const pj_uint16_t PJ_SOL_TCP  = SOL_TCP;

#elif defined(IPPROTO_TCP)

const pj_uint16_t PJ_SOL_TCP  = IPPROTO_TCP;

#else

const pj_uint16_t PJ_SOL_TCP  = 0xFFFF;

#endif /* SOL_TCP */

3.    Linker warning: ctype.obj no public symbols found; archive member
will be inaccessible.  The pj_hex_digits character array has been
refactored to a string, and the definition for the character array in
ctype.c has been commented out.  I'm sure you had reasons for changing
from a char array to a string, perhaps for fixing some issues with
embedded operating systems.  However, since there is nothing useful in
the ctype.c file, are you planning on getting rid of this file, or
adding code back in to it?

By making the changes for item 1 and 2, I am able to successfully
compile the code.  Item #2 was a hard error and required a change.  The
other two items are more for cleaning up the code.

 

Regards,

Jim Gomes
Senior Software Engineer
Gate Technologies
Tideworks Technology, Inc.
(206) 382-2197

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20071019/573d812e/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 2743 bytes
Desc: image001.jpg
Url : http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20071019/573d812e/attachment.jpe 


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux