Bug 11629 - warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
warning: comparison of constant 234 with expression of type 'NET_API_STATUS' ...
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build
4.3.1
All All
: P5 normal
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-02 04:08 UTC by Timur Bakeyev
Modified: 2015-12-02 04:08 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timur Bakeyev 2015-12-02 04:08:59 UTC
Clang exposes numerous warnings like:

warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false

Not sure how bad is this to the logic, but...

../source4/torture/libnetapi/libnetapi_group.c../source4/torture/libnetapi/libnetapi_user.c:64:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
122:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source4/torture/libnetapi/libnetapi_user.c:172:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
165:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source4/torture/libnetapi/libnetapi_group.c:204:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source4/torture/libnetapi/libnetapi_user.c:287:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source4/torture/libnetapi/libnetapi_group.c../source4/torture/libnetapi/libnetapi_user.c:329:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/utils/net_rpc.c:1210:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netlocalgroup.c:56:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netlocalgroup.c:96:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netuser.c:64:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netuser.c:169:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netuser.c:281:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netuser.c:323:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netgroup.c:58:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netgroup.c:116:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netgroup.c:158:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netgroup.c:197:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netgroup.c:377:../source3/lib/netapi/tests/netdisplay.c:56:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
:106:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netshare.c:57:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netshare.c:106:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netfile.c:55:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/tests/netfile.c:88:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/user/user_enum.c:89:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/user/user_enum.c:145:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/user/user_dispinfo.c:78:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/user/user_dispinfo.c:88:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/user/user_getgroups.c:91:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/user/user_getgroups.c:121:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/user/user_getlocalgroups.c:88:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/user/user_getlocalgroups.c:110:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/group/group_enum.c:88:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/group/group_enum.c:141:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/group/group_getusers.c:93:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/group/group_getusers.c:120:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/localgroup/localgroup_enum.c:85:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/localgroup/localgroup_enum.c:114:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/localgroup/localgroup_getmembers.c:95:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/localgroup/localgroup_getmembers.c:153:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/share/share_enum.c:86:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/share/share_enum.c:130:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/file/file_enum.c:102:29: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false
../source3/lib/netapi/examples/file/file_enum.c:134:18: warning: comparison of constant 234 with expression of type 'NET_API_STATUS' is always false


They all related to the code like:

status == ERROR_MORE_DATA

There are similar warnings:

../source3/lib/netapi/tests/netlocalgroup.c:192:24: warning: comparison of constant 124 with expression of type 'NET_API_STATUS' is always true [-Wtautological-constant-out-of-range-compare]

       if (status && status != 124) {