FALL_THROUGH attribute and AIX build

Amitay Isaacs amitay at gmail.com
Tue Feb 19 07:24:13 UTC 2019


Hi,

AIX compiler xlc fails to build socket_wrapper.c.

[178/365] Compiling third_party/socket_wrapper/socket_wrapper.c
"../../../third_party/socket_wrapper/socket_wrapper.c", line 603.17:
1506-046 (S) Syntax error.
"../../../third_party/socket_wrapper/socket_wrapper.c", line 622.17:
1506-046 (S) Syntax error.

The check for the fall through attribute uses the following pattern for testing:

    case 1:
        statemant;
        FALL_THROUGH;
    case 2:
         statement;
         break;

However, in socket_wrapper FALL_THROUGH is used with following pattern:

   case 1:
       FALL_THROUGH;
    case 2:
        statement;
        break;

Clearly, there is no reason for using FALL_THROUGH when the two case
statements have common code (or there is an empty case statement).  So
it could simply be:

    case 1:
    case 2:
        statement;
        break;

If we want to insist on using FALL_THROUGH attribute for empty case
statements, then we should correct the test for checking FALL_THROUGH
attribute.

Attached is a potential patch to socket_wrapper.

Amitay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-socket_wrapper-Drop-FALL_THROUGH-for-empty-case-stat.patch
Type: text/x-patch
Size: 1014 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190219/0e6b27eb/0001-socket_wrapper-Drop-FALL_THROUGH-for-empty-case-stat.bin>


More information about the samba-technical mailing list