You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "nadir amra (JIRA)" <ji...@apache.org> on 2010/06/01 18:37:37 UTC

[jira] Closed: (AXIS2C-1467) Dangerous macros defs in axutil_unix.h and axutil_windows.h

     [ https://issues.apache.org/jira/browse/AXIS2C-1467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nadir amra closed AXIS2C-1467.
------------------------------

    Fix Version/s: Current (Nightly)
       Resolution: Fixed

Fixed in revision http://svn.apache.org/viewvc?view=revision&revision=950151

> Dangerous macros defs in axutil_unix.h and axutil_windows.h
> -----------------------------------------------------------
>
>                 Key: AXIS2C-1467
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1467
>             Project: Axis2-C
>          Issue Type: Improvement
>    Affects Versions: 1.6.0, Current (Nightly)
>            Reporter: Olivier Mengué
>            Priority: Trivial
>             Fix For: Current (Nightly)
>
>         Attachments: AXIS2C-1467_macros.patch
>
>
> Same macros in axutil_unix.h have dangerous definitions:
> - ';' at the end of a definition that is defined like a function
> - multiple statement without enclosing block
> Those mistakes can be dangerous when the macro is called in the "then" part of an "if" statement.
> Examples:
> #define AXIS2_CLOSE_SOCKET_ON_EXIT(sock)    fcntl(sock,F_SETFD, FD_CLOEXEC);
> #define AXIS2_UNZOPEN2(zipfilename,ffunc) unzOpen2(zipfilename,NULL); memset(&ffunc, 0, sizeof(ffunc));
> The first error is fixed by removing the ';'. The second one by enclosing the definition in "do { ... } while (0)".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org